System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2012-06-18
11:08
Modify the test suite cleanup semantics to allow the deferred close functionality to work correctly. Also, fix the database cleanup ordering in the tests for ticket [343d392b51]. check-in: 9b92396ca2 user: mistachkin tags: trunk
2012-02-29
14:54 Closed ticket [4bbf851fa5]: DBConcurrencyException plus 1 other change artifact: 774e22236e user: mistachkin
2012-02-19
12:35 Ticket [4bbf851fa5]: 1 change artifact: d4963672c0 user: mistachkin
12:35 Ticket [4bbf851fa5]: 1 change artifact: f4db9f273a user: mistachkin
2012-02-15
05:59 Closed ticket [d76b409d07]: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records plus 1 other change artifact: 06d958f7cf user: mistachkin
2012-01-25
21:10 Ticket [d76b409d07]: 4 changes artifact: 8a007133a5 user: mistachkin
18:28 Closed ticket [6f00b44ccc]: Possible bug with DataSet designer for Compact platform plus 4 other changes artifact: 0c4560bac3 user: mistachkin
2012-01-16
01:05 Ticket [4bbf851fa5] DBConcurrencyException status still Closed with 1 other change artifact: fdf59cd932 user: mistachkin
01:00 Ticket [4bbf851fa5]: 1 change artifact: 6646195e03 user: mistachkin
2011-12-27
22:00 Closed ticket [4bbf851fa5]. artifact: 6d4b9be4af user: mistachkin
2011-12-25
16:52 New ticket [4bbf851fa5]. artifact: 445070618b user: anonymous
2011-10-18
09:06 Closed ticket [343d392b51]: DBConcurrencyException with attached database plus 4 other changes artifact: d742f572a9 user: mistachkin
2011-10-11
07:21
Merge all fixes, enhancements, and tests related to ticket [343d392b51] into trunk. check-in: fc49363310 user: mistachkin tags: trunk
2011-10-10
03:32 Ticket [343d392b51] DBConcurrencyException with attached database status still Pending with 1 other change artifact: 21b515d66d user: mistachkin
02:46 Ticket [343d392b51]: 1 change artifact: d22dd581a9 user: anonymous
2011-10-09
03:58 Ticket [343d392b51]: 1 change artifact: 2904f447e7 user: mistachkin
03:19
Copy the fix for the Bind_DateTime method to the SQLite3_UTF16 class. Add DateTimeKind connection string property to control the DateTimeKind of parsed DateTime values. Add the necessary method overloads to allow the DateTimeFormat and/or DateTimeKind to be specified by external callers. Reorganize the recognized DateTime formats so that ones with more information are always tried first. Also, add variants that support a trailing timezone specifier. Centralize DateTime format handling in the unit test infrastructure via the new getDateTimeFormat procedure. Revise setupDb unit test infrastructure procedure to accept a DateTimeKind. More changes to tests for ticket [343d392b51]. check-in: df7dcd3166 user: mistachkin tags: tkt-343d392b51
2011-10-08
11:36 Ticket [343d392b51] DBConcurrencyException with attached database status still Pending with 2 other changes artifact: 50004fbb09 user: mistachkin
11:01
When returning schema information that may be used by the .NET Framework to construct dynamic SQL, use a fake schema name (instead of null) so that the table names will be properly qualified with the catalog name (i.e. the attached database name). Refactor handling of arguments for the setupDb unit test infrastructure procedure. Allow the build and binary directories used by the unit testing infrastructure to be overridden. Add more tests related to ticket [343d392b51]. check-in: 2d2ef4ffcc user: mistachkin tags: tkt-343d392b51
2011-10-07
00:30
Start of work to resolve ticket [343d392b51]. check-in: 030e404034 user: mistachkin tags: tkt-343d392b51
2011-10-06
10:56 Ticket [343d392b51] DBConcurrencyException with attached database status still Pending with 1 other change artifact: e6eea3a3a1 user: anonymous
10:54
Update test case for ticket [343d392b51] as it now reproduces the issue. check-in: 41413183d3 user: mistachkin tags: tkt-343d392b51
09:59 Ticket [343d392b51] DBConcurrencyException with attached database status still Pending with 1 other change artifact: 11a5e6ae3b user: mistachkin
07:33 Ticket [343d392b51]: 2 changes artifact: a25369034d user: anonymous
05:40 Ticket [343d392b51]: 1 change artifact: 022539e97a user: mistachkin
05:34 Ticket [343d392b51]: 1 change artifact: f89f821369 user: mistachkin
2011-10-05
20:59 Ticket [343d392b51]: 1 change artifact: 799a3e6d5d user: anonymous
2011-09-29
06:31 Ticket [343d392b51]: 2 changes artifact: abeb69d3cc user: mistachkin
06:14 Pending ticket [343d392b51]. artifact: aed6170b4d user: mistachkin
04:45
Add experimental test for ticket [343d392b51] (so far, no exception is raised). check-in: 6c53fbe92c user: mistachkin tags: tkt-343d392b51
2011-09-28
07:40 Ticket [343d392b51] DBConcurrencyException with attached database status still Open with 2 other changes artifact: 38203e2432 user: mistachkin
2011-09-27
22:51 Ticket [343d392b51]: 4 changes artifact: dc9d8512cd user: mistachkin
02:07 New ticket [343d392b51]. artifact: 9e02186c2b user: anonymous

Ticket Hash: 343d392b51b98bb79584a847daa7eb65a2e3d811
Title: DBConcurrencyException with attached database
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Db_Type_Conversion Resolution: Fixed
Last Modified: 2011-10-18 09:06:12
Version Found In: 1.0.76.0
Description:
DBConcurrencyException with Attached Database (I still use 1.0.66.0 because of these Interop problems describes in other tickets)

I have a main database with an attched database and I don't use any threads by my self.

my simple code:

... try { sql = "select * from xy.table where ..."; da = new SQLiteDataAdapter(sql, db_con);

da.Fill(ds, tab);
dt = ds.Tables[tab];
// Indicate DataColumn ID is unique // This is required by the CommandBuilder to update the table dt.Columns["ID"].Unique = true; // and set the primery key // is needed for the .Find-Command DataColumn[] PrimaryKeys = new DataColumn[1]; PrimaryKeys[0] = dt.Columns["ID"]; dt.PrimaryKey = PrimaryKeys; SQLiteCommandBuilder builder = new SQLiteCommandBuilder(da);
manipulate_data();
// da.UpdateBatchSize = 100; not supported at this time
int i = da.Update(dt); // here the DBConcurrencyException raises !!!

After updating round about 150 rows the exception raises. If the table has just one row the exception raises immediately.

If I move the table to the main database, these problems do not appear.

regards, Simon


mistachkin added on 2011-09-27 22:51:45 UTC:
1.0.66.0 is no longer supported as it was released in April 2010. Please try using a newer version (such as the NuGet package, which contains statically linked binaries) and let me know if you still see the error in question.


mistachkin added on 2011-09-28 07:40:55 UTC:
Possibly related to your problem: http://sqlite.phxsoftware.com/forums/p/1103/4711.aspx


mistachkin added on 2011-09-29 06:14:36 UTC:
I have been unable to reproduce this issue with either 1.0.66.0 or the latest version. I suspect that I'm missing key information about the nature of the perceived problem here. For example, what does the "manipulate_data" function do?


anonymous added on 2011-10-05 20:59:48 UTC:
I upgraded to 1.0.76.0 but the DBConcurrencyException still remains

the manipulate_data function does change the contents of a single column (for one row)


mistachkin added on 2011-10-06 05:34:35 UTC:
Is it possible for you to supply any additional information about your environment or the specific circumstances of the issue you are seeing? So far, I am not able to reproduce it.


mistachkin added on 2011-10-06 05:40:28 UTC:
The current test case I have going is here: tkt-343d392b51.eagle

Am I missing any of the steps you are doing in your code?


anonymous added on 2011-10-06 07:33:30 UTC:
your test code is nearly exactly what I'm doing. It's a strange behaviour: I constructed an attached DB with just one table "product", containing 5 columns. CHANGE_DATE (DateTime), ID (integer primary key), PRODUCT_CODE1 (varchar2), PRODUCT_CODE2 (varchar2), PRICE (number). The table contains 189 rows. the select-statement queries some of them (152) into the local ADO-table. I change the CHANGE_DATE column (to Date.Now) and the PRICE column (PRICE += 1.5). After that I do wait for 5 seconds (for whatever - it has no effect). Then I do the adapter.update. after updating 141 rows the exception raises on the 142th row. If I exclude this special row in my select then the exception does not appear. If I delete this special row an all others except one (so the table does contain just 1 single row) the exception again appear (no matter which product is left in the table, so the content of the table is not the reason). Hint: In between the processing of the attached DB, I write some log-information to a log table into the main-DB. I think it has something to do with block size, or so. Really strange. I'm not an really expert on C#, so the information I can extract out of the exception is more or less useless for me, saying just that there is an DBConcurrencyException. What can I do ? My production CPU is i7 870 2.93GHz with 8GB RAM 64-Bit Win7 But I still develop on 32Bit Vista with VS 2008 3.5 SP1 .NET The exception raises on both PCs.


mistachkin added on 2011-10-06 09:59:20 UTC:
I am now able to reproduce the bug... It has something to do with the DATETIME column.


anonymous added on 2011-10-06 10:56:36 UTC:

try {
log("start updates");
System.Threading.Thread.Sleep(5000);
int i = da.Update(dt);
log("updates: " + i);
return i;
}
catch (DBConcurrencyException e) { log("Error on Update - DBConcurrencyException: " + e.Row[0].ToString() + " - " + e.Row[1].ToString() + " - " + e.Row[2].ToString() + " - " + e.Row[3].ToString() + " - " + e.Row[4].ToString() + " - RowCount:" + e.RowCount); log("Error on Update - DBConcurrencyException: RowCount:" + e.RowCount + " - TargetSite: " + e.TargetSite + " - Message: " + e.Message.ToString() + " - Data: " + e.Data.ToString());
log("Error on Update - DBConcurrencyException: InnerException: " + e.InnerException.ToString() );
return -1; } }

the >> e.InnerException.ToString() << again raises an exception.


mistachkin added on 2011-10-08 11:36:04 UTC:
I've got a partial fix for this on the tkt-343d392b51 branch. Now, if you use the DateTimeFormat=JulianDay or UnixEpoch in the connection string, parameterized queries will work properly, fixing this issue in your case. However, if the default ISO8601 DateTimeFormat is used for the connection, there is not much that can be done due to how DATETIME columns are handled by SQLite (i.e. using TEXT operator semantics).


mistachkin added on 2011-10-09 03:58:22 UTC:
I've added some more changes to fix various things discovered while investigating this issue, including new tests. These changes are not in the trunk yet.


anonymous added on 2011-10-10 02:46:42 UTC:
An attached DB is a DB like a main DB (the same file structure) and it should be treated exactly in the same way like a main DB by SQLite. So the question is why an attached DB is processed differently !


mistachkin added on 2011-10-10 03:32:07 UTC:
One of the problems is that the .NET Framework assumes that there can be no database name without a schema name (which SQLite does not support); however, I have implemented a workaround in the branch for this ticket. The root of your issues was the DbCommandBuilder class in the framework itself. It makes certain assumptions that do not hold true for SQLite.


mistachkin added on 2011-10-18 09:06:12 UTC:
Fixed in trunk by check-in [fc49363310].