Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JDBC batch writing and native queries: flush() doesn't work

As requested, I created a bug report for this, see:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=323370



Zitat von James Sutherland <jamesssss@xxxxxxxxx>:


It seems the batch is not being flushed because there were no changes, the
native query was thought to have already been executed.  Please log a bug
for this, the batch should always get flushed on flush, even with no
changes.

It is also odd that the native query is batched at all.  This seems to be
our default when batching, but can be set on the ModifyQuery using
setForceBatchStatementExecution(true).  There does not seem to be a query
hint for this though, so please add this to the bug.


patric-7 wrote:

Hi,

it seems that when JDBC batch writing mode has been enabled, a flush()
won't trigger the execution of the "saved" statement under certain
circumstances:

Steps to reproduce this:

0. enable batch writing in mode "JDBC"
1. create an EntityManager
2. create and execute a native query which consists of a simple insert
3. call flush() on the entity manager.

=> Nothing will be written to the database. It seems that the changes
will only be persisted when commiting the transaction.

Is this a "feature" (and not a bug) and is there a workaround for this
problem? (except disabling jdbc batch writing).

Thank you.

Best regards,
Patric




-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://old.nabble.com/JDBC-batch-writing-and-native-queries%3A-flush%28%29-doesn%27t-work-tp29472217p29523274.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users







Back to the top