[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [eclipselink-users] How to disable auto-commit in EclipseLink
- From: patric@xxxxxxxxxxx
- Date: Thu, 16 Dec 2010 12:32:30 +0100
- Delivered-to: email@example.com
- User-agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.2)
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:
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,
eclipselink-users mailing list