System.Data.SQLite
Check-in [a6dfd19657]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a6dfd19657992b5e32e591a52e77992e58c4bd8b
User & Date: mistachkin 2013-10-15 06:52:20
References
2013-10-15
06:53 Closed ticket [9ba9346f75]: bool SQLiteConnection.AutoCommit { get; } to expose sqlite3_get_autocommit() plus 6 other changes artifact: 5093d65dd0 user: mistachkin
Context
2013-10-17
02:48
Update SQLite core library to the latest trunk code. Add test to verify that the 'totype' extension can be loaded and used. check-in: 6cb6f18893 user: mistachkin tags: trunk
2013-10-15
06:52
Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75]. check-in: a6dfd19657 user: mistachkin tags: trunk
06:26
Update SQLite core library to the latest trunk code. Add the 'totype' extension. check-in: 159d24c754 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/version.html.

    42     42       </div>
    43     43       <div id="mainSection">
    44     44       <div id="mainBody">
    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.89.0 - September XX, 2013 <font color="red">(release scheduled)</font></b></p>
    47     47       <ul>
    48     48         <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.8.1</a>.</li>
           49  +      <li>Add AutoCommit property to the SQLiteConnection class. Fix for <a href="http://system.data.sqlite.org/index.html/info/9ba9346f75">[9ba9346f75]</a>.</li>
    49     50         <li>Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for <a href="http://system.data.sqlite.org/index.html/info/3113734605">[3113734605]</a>.</li>
    50     51         <li>Check the result of sqlite3_column_name function against NULL.</li>
    51     52         <li>Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.</li>
    52     53         <li>Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for <a href="http://system.data.sqlite.org/index.html/info/aba4549801">[aba4549801]</a>.</li>
    53     54         <li>Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.</li>
    54     55         <li>Revise how the extra object data is passed to the static SQLiteConnection.Changed event.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    55     56         <li>Make sure the database cannot be changed by a query when the CommandBehavior.SchemaOnly flag is used. Fix for <a href="http://system.data.sqlite.org/index.html/info/f8dbab8baf">[f8dbab8baf]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>

Changes to System.Data.SQLite/SQLiteBase.cs.

   380    380       internal abstract bool IsInitialized();
   381    381   
   382    382       internal abstract int GetCursorForTable(SQLiteStatement stmt, int database, int rootPage);
   383    383       internal abstract long GetRowIdForCursor(SQLiteStatement stmt, int cursor);
   384    384   
   385    385       internal abstract object GetValue(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, SQLiteType typ);
   386    386   
          387  +    /// <summary>
          388  +    /// Returns non-zero if the given database connection is in autocommit mode.
          389  +    /// Autocommit mode is on by default.  Autocommit mode is disabled by a BEGIN
          390  +    /// statement.  Autocommit mode is re-enabled by a COMMIT or ROLLBACK.
          391  +    /// </summary>
   387    392       internal abstract bool AutoCommit
   388    393       {
   389    394         get;
   390    395       }
   391    396   
   392    397       internal abstract SQLiteErrorCode FileControl(string zDbName, int op, IntPtr pArg);
   393    398   

Changes to System.Data.SQLite/SQLiteConnection.cs.

  2400   2400   
  2401   2401           if (_sql == null)
  2402   2402             throw new InvalidOperationException("Database connection not valid for getting number of changes.");
  2403   2403   
  2404   2404           return _sql.Changes;
  2405   2405         }
  2406   2406       }
         2407  +
         2408  +    /// <summary>
         2409  +    /// Returns non-zero if the given database connection is in autocommit mode.
         2410  +    /// Autocommit mode is on by default.  Autocommit mode is disabled by a BEGIN
         2411  +    /// statement.  Autocommit mode is re-enabled by a COMMIT or ROLLBACK.
         2412  +    /// </summary>
         2413  +#if !PLATFORM_COMPACTFRAMEWORK
         2414  +    [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
         2415  +#endif
         2416  +    public bool AutoCommit
         2417  +    {
         2418  +        get
         2419  +        {
         2420  +            CheckDisposed();
         2421  +
         2422  +            if (_sql == null)
         2423  +                throw new InvalidOperationException("Database connection not valid for getting autocommit mode.");
         2424  +
         2425  +            return _sql.AutoCommit;
         2426  +        }
         2427  +    }
  2407   2428   
  2408   2429       /// <summary>
  2409   2430       /// Returns the amount of memory (in bytes) currently in use by the SQLite core library.
  2410   2431       /// </summary>
  2411   2432   #if !PLATFORM_COMPACTFRAMEWORK
  2412   2433       [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  2413   2434   #endif

Added Tests/tkt-9ba9346f75.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-9ba9346f75.eagle --
            4  +#
            5  +# Written by Joe Mistachkin.
            6  +# Released to the public domain, use at your own risk!
            7  +#
            8  +###############################################################################
            9  +
           10  +package require Eagle
           11  +package require Eagle.Library
           12  +package require Eagle.Test
           13  +
           14  +runTestPrologue
           15  +
           16  +###############################################################################
           17  +
           18  +package require System.Data.SQLite.Test
           19  +runSQLiteTestPrologue
           20  +
           21  +###############################################################################
           22  +
           23  +runTest {test tkt-9ba9346f75-1.1 {AutoCommit property} -setup {
           24  +  setupDb [set fileName tkt-9ba9346f75-1.1.db]
           25  +} -body {
           26  +  set connection [getDbConnection]
           27  +
           28  +  set result [list]
           29  +
           30  +  lappend result [object invoke $connection AutoCommit]; # True
           31  +
           32  +  sql execute $db "CREATE TABLE t1(x);"
           33  +  lappend result [object invoke $connection AutoCommit]; # True
           34  +
           35  +  sql execute $db "INSERT INTO t1 (x) VALUES(1);"
           36  +  lappend result [object invoke $connection AutoCommit]; # True
           37  +
           38  +  sql execute $db "BEGIN TRANSACTION;"
           39  +  lappend result [object invoke $connection AutoCommit]; # False
           40  +
           41  +  sql execute $db "INSERT INTO t1 (x) VALUES(1);"
           42  +  lappend result [object invoke $connection AutoCommit]; # False
           43  +
           44  +  sql execute $db "COMMIT;"
           45  +  lappend result [object invoke $connection AutoCommit]; # True
           46  +
           47  +  set result
           48  +} -cleanup {
           49  +  cleanupDb $fileName
           50  +
           51  +  freeDbConnection
           52  +
           53  +  unset -nocomplain result connection db fileName
           54  +} -constraints \
           55  +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
           56  +{True True True False False True}}
           57  +
           58  +###############################################################################
           59  +
           60  +runSQLiteTestEpilogue
           61  +runTestEpilogue

Changes to readme.htm.

   187    187   <h2><b>Version History</b></h2>
   188    188   
   189    189   <p>
   190    190       <b>1.0.89.0 - September XX, 2013 <font color="red">(release scheduled)</font></b>
   191    191   </p>
   192    192   <ul>
   193    193       <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.8.1</a>.</li>
          194  +    <li>Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].</li>
   194    195       <li>Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].</li>
   195    196       <li>Check the result of sqlite3_column_name function against NULL.</li>
   196    197       <li>Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.</li>
   197    198       <li>Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].</li>
   198    199       <li>Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.</li>
   199    200       <li>Revise how the extra object data is passed to the static SQLiteConnection.Changed event.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   200    201       <li>Make sure the database cannot be changed by a query when the CommandBehavior.SchemaOnly flag is used. Fix for [f8dbab8baf].&nbsp;<b>** Potentially Incompatible Change **</b></li>

Changes to www/news.wiki.

     3      3   <b>Version History</b>
     4      4   
     5      5   <p>
     6      6       <b>1.0.89.0 - September XX, 2013 <font color="red">(release scheduled)</font></b>
     7      7   </p>
     8      8   <ul>
     9      9       <li>Updated to [http://www.sqlite.org/src/info/trunk|SQLite 3.8.1].</li>
           10  +    <li>Add AutoCommit property to the SQLiteConnection class. Fix for [9ba9346f75].</li>
    10     11       <li>Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].</li>
    11     12       <li>Check the result of sqlite3_column_name function against NULL.</li>
    12     13       <li>Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.</li>
    13     14       <li>Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].</li>
    14     15       <li>Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.</li>
    15     16       <li>Revise how the extra object data is passed to the static SQLiteConnection.Changed event.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    16     17       <li>Make sure the database cannot be changed by a query when the CommandBehavior.SchemaOnly flag is used. Fix for [f8dbab8baf].&nbsp;<b>** Potentially Incompatible Change **</b></li>