Index: Doc/Extra/version.html
==================================================================
--- Doc/Extra/version.html
+++ Doc/Extra/version.html
@@ -44,10 +44,11 @@
Version History
1.0.89.0 - September XX, 2013 (release scheduled)
- Updated to SQLite 3.8.1.
+ - Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].
- Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
- Check the result of sqlite3_column_name function against NULL.
- Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
- Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
- Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.
Index: System.Data.SQLite/SQLiteBase.cs
==================================================================
--- System.Data.SQLite/SQLiteBase.cs
+++ System.Data.SQLite/SQLiteBase.cs
@@ -382,10 +382,15 @@
internal abstract int GetCursorForTable(SQLiteStatement stmt, int database, int rootPage);
internal abstract long GetRowIdForCursor(SQLiteStatement stmt, int cursor);
internal abstract object GetValue(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, SQLiteType typ);
+ ///
+ /// Returns non-zero if the given database connection is in autocommit mode.
+ /// Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN
+ /// statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK.
+ ///
internal abstract bool AutoCommit
{
get;
}
Index: System.Data.SQLite/SQLiteConnection.cs
==================================================================
--- System.Data.SQLite/SQLiteConnection.cs
+++ System.Data.SQLite/SQLiteConnection.cs
@@ -2402,10 +2402,31 @@
throw new InvalidOperationException("Database connection not valid for getting number of changes.");
return _sql.Changes;
}
}
+
+ ///
+ /// Returns non-zero if the given database connection is in autocommit mode.
+ /// Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN
+ /// statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK.
+ ///
+#if !PLATFORM_COMPACTFRAMEWORK
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#endif
+ public bool AutoCommit
+ {
+ get
+ {
+ CheckDisposed();
+
+ if (_sql == null)
+ throw new InvalidOperationException("Database connection not valid for getting autocommit mode.");
+
+ return _sql.AutoCommit;
+ }
+ }
///
/// Returns the amount of memory (in bytes) currently in use by the SQLite core library.
///
#if !PLATFORM_COMPACTFRAMEWORK
ADDED Tests/tkt-9ba9346f75.eagle
Index: Tests/tkt-9ba9346f75.eagle
==================================================================
--- /dev/null
+++ Tests/tkt-9ba9346f75.eagle
@@ -0,0 +1,61 @@
+###############################################################################
+#
+# tkt-9ba9346f75.eagle --
+#
+# Written by Joe Mistachkin.
+# Released to the public domain, use at your own risk!
+#
+###############################################################################
+
+package require Eagle
+package require Eagle.Library
+package require Eagle.Test
+
+runTestPrologue
+
+###############################################################################
+
+package require System.Data.SQLite.Test
+runSQLiteTestPrologue
+
+###############################################################################
+
+runTest {test tkt-9ba9346f75-1.1 {AutoCommit property} -setup {
+ setupDb [set fileName tkt-9ba9346f75-1.1.db]
+} -body {
+ set connection [getDbConnection]
+
+ set result [list]
+
+ lappend result [object invoke $connection AutoCommit]; # True
+
+ sql execute $db "CREATE TABLE t1(x);"
+ lappend result [object invoke $connection AutoCommit]; # True
+
+ sql execute $db "INSERT INTO t1 (x) VALUES(1);"
+ lappend result [object invoke $connection AutoCommit]; # True
+
+ sql execute $db "BEGIN TRANSACTION;"
+ lappend result [object invoke $connection AutoCommit]; # False
+
+ sql execute $db "INSERT INTO t1 (x) VALUES(1);"
+ lappend result [object invoke $connection AutoCommit]; # False
+
+ sql execute $db "COMMIT;"
+ lappend result [object invoke $connection AutoCommit]; # True
+
+ set result
+} -cleanup {
+ cleanupDb $fileName
+
+ freeDbConnection
+
+ unset -nocomplain result connection db fileName
+} -constraints \
+{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
+{True True True False False True}}
+
+###############################################################################
+
+runSQLiteTestEpilogue
+runTestEpilogue
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -189,10 +189,11 @@
1.0.89.0 - September XX, 2013 (release scheduled)
- Updated to SQLite 3.8.1.
+ - Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].
- Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
- Check the result of sqlite3_column_name function against NULL.
- Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
- Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
- Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -5,10 +5,11 @@
1.0.89.0 - September XX, 2013 (release scheduled)
- Updated to [http://www.sqlite.org/src/info/trunk|SQLite 3.8.1].
+ - Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].
- Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
- Check the result of sqlite3_column_name function against NULL.
- Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
- Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
- Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.