Identity insert fails with SQL Ce dialect and aggressive connection release mode.
Description
An entity's mapping document specifies that the identity Id generator will be used. The entity is inserted into a SQL CE database. The data is successfully inserted into the database but the session save operation fails when using aggressive connection release mode. The error occurs because the id is attempted to be selected on a different connection than the connection that issued the insert.
The workaround is to disable aggresive release mode.
Was closed because fixed by commit 3f304ed. But some later port of Hibernate changes lost this fix. (2716624 & 3ce5929)
Alex Zaytsev
January 22, 2014 at 3:54 AM
(edited)
Can anyone point me to discussion of this?
OrenE
March 1, 2007 at 2:28 AM
The issue was discussed on the mailing list. It has to do of not making the select last_insert_id() at the same batch as the insert. This works for dialects that have Insert+Identity enabled only.
Former user
March 1, 2007 at 2:13 AM
Looks like it wasn't fixed.
Former user
February 27, 2007 at 2:01 PM
Should be fixed in CR1. Please test that and comment here if it doesn't work.
An entity's mapping document specifies that the identity Id generator will be used. The entity is inserted into a SQL CE database. The data is successfully inserted into the database but the session save operation fails when using aggressive connection release mode. The error occurs because the id is attempted to be selected on a different connection than the connection that issued the insert.
The workaround is to disable aggresive release mode.