SQLite connector for UserAccounts and Auth works. Yey!

This commit is contained in:
Diva Canto
2010-02-21 08:47:24 -08:00
parent 56fb7821ad
commit 8a4947f8c7
4 changed files with 70 additions and 54 deletions

View File

@@ -48,6 +48,7 @@ namespace OpenSim.Data.SQLite
protected string m_Realm;
protected FieldInfo m_DataField = null;
protected static SqliteConnection m_Connection;
private static bool m_initialized;
public SQLiteGenericTableHandler(string connectionString,
@@ -63,9 +64,14 @@ namespace OpenSim.Data.SQLite
if (storeName != String.Empty)
{
Assembly assem = GetType().Assembly;
SqliteConnection newConnection =
(SqliteConnection)((ICloneable)m_Connection).Clone();
newConnection.Open();
Migration m = new Migration(m_Connection, assem, storeName);
Migration m = new Migration(newConnection, assem, storeName);
m.Update();
newConnection.Close();
newConnection.Dispose();
}
m_initialized = true;
@@ -136,7 +142,7 @@ namespace OpenSim.Data.SQLite
protected T[] DoQuery(SqliteCommand cmd)
{
IDataReader reader = ExecuteReader(cmd);
IDataReader reader = ExecuteReader(cmd, m_Connection);
if (reader == null)
return new T[0];
@@ -191,7 +197,7 @@ namespace OpenSim.Data.SQLite
result.Add(row);
}
CloseReaderCommand(cmd);
CloseCommand(cmd);
return result.ToArray();
}
@@ -240,7 +246,7 @@ namespace OpenSim.Data.SQLite
cmd.CommandText = query;
if (ExecuteNonQuery(cmd) > 0)
if (ExecuteNonQuery(cmd, m_Connection) > 0)
return true;
return false;
@@ -253,7 +259,7 @@ namespace OpenSim.Data.SQLite
cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field);
cmd.Parameters.Add(new SqliteParameter(field, val));
if (ExecuteNonQuery(cmd) > 0)
if (ExecuteNonQuery(cmd, m_Connection) > 0)
return true;
return false;