Hi,

This probably has nothing to do with MfA, though, any insights are welcome
as my experience with sqlite isn't much. I'm trying to to a bulk insert
with 3000 records. It seems to be a good idea to reuse the same command
object and to do this inside a transaction, so, that's what I'm doing...

                            AppDb db = AppDb.GetInstance( this ); // this
basically creates a connection object; has some handling to know where to
write the file
                            SqliteCommand dbCmd = db.CreateCommand(); //
Connection.CreateCommand()

                            db.Open(); // Connection.Open()

                            SqliteTransaction dbTransaction =
db.BeginTransaction(); // Connection.BeginTransaction()

                            foreach ( Translation p in buffer.Data )
                            {
                                db.ExecuteNonQueryRecyclable( dbCmd,
"insert into Translations ( LCID, [Key], [Value] ) values ( {0}, {1}, {2}
)", p.LCID, p.Key, p.Value ); // in essence calls dbCmd.ExecuteNonQuery()
                            }

*                            dbTransaction.Commit(); // this is throwing an
error stating that there is no active transaction*

Any thoughts? Am I doing something wrong?
Cheers


-- 
Gonçalo Oliveira
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to