- Add Dispose method to IRegionDataStore

- Add necessary dummy Dispose-methods where they are missing
- Implement the SQLite Dispose-methods
(currently only used for unit tests, in the next commit)
This commit is contained in:
Homer Horwitz
2008-09-18 20:10:09 +00:00
parent 48978ba3e0
commit 1c08f46ec3
9 changed files with 115 additions and 10 deletions

View File

@@ -46,6 +46,7 @@ namespace OpenSim.Data.SQLite
private const string invItemsSelect = "select * from inventoryitems";
private const string invFoldersSelect = "select * from inventoryfolders";
private SqliteConnection conn;
private DataSet ds;
private SqliteDataAdapter invItemsDa;
private SqliteDataAdapter invFoldersDa;
@@ -71,7 +72,7 @@ namespace OpenSim.Data.SQLite
dbconnect = "URI=file:inventoryStore.db,version=3";
}
m_log.Info("[INVENTORY DB]: Sqlite - connecting: " + dbconnect);
SqliteConnection conn = new SqliteConnection(dbconnect);
conn = new SqliteConnection(dbconnect);
conn.Open();
@@ -101,6 +102,29 @@ namespace OpenSim.Data.SQLite
ds.AcceptChanges();
}
/// <summary>
/// Closes the inventory interface
/// </summary>
public void Dispose()
{
if(conn != null) {
conn.Close();
conn = null;
}
if(invItemsDa != null) {
invItemsDa.Dispose();
invItemsDa = null;
}
if(invFoldersDa != null) {
invFoldersDa.Dispose();
invFoldersDa = null;
}
if(ds != null) {
ds.Dispose();
ds = null;
}
}
/// <summary>
///
/// </summary>
@@ -277,13 +301,6 @@ namespace OpenSim.Data.SQLite
// TODO: DataSet commit
}
/// <summary>
/// Closes the inventory interface
/// </summary>
public void Dispose()
{
}
/// <summary>
/// The name of this DB provider
/// </summary>