Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to disable auto-commit in EclipseLink

After tracing and looking through the source code I think that this issue is even more crucial: EclipseLink will only enable auto-commit after a rollback() or commit() of a transaction:

Please have a look at DatabaseAccessor.java:

basicBeginTransaction() will disable auto-commit()
basicCommitTransaction() will enable auto-commit()
basicRollbackTransaction() will also enable auto-commit()

This means that the result in the database of some JPA operations may differ if a tranaction has been rollbacked or committed before.

Why has it been implemented that way?
Is it an intentional behaviour?

Zitat von patric@xxxxxxxxxxx:

Hi,

I just saw that EclipseLink tries to enable the autocommit functionality on the Connection object in some cases.
How can I disable that?
Because I am sharing the Connection which is used by EclipseLink with some other transaction controller an auto-commit simply break the transaction concept.

If there's no such functionality - is it safe to intercept EclipseLink's setAutoCommit(true) invocation by my Connection wrapper?

Thank you and best regards,
Patric



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







Back to the top