|
|
Re: EJB transaction does not rollback stored procedure changes [message #667904 is a reply to message #667895] |
Mon, 02 May 2011 17:39 |
|
How are you executing the procedure?
By default in EclipseLink if you execute a Query through getResultList() or getSingleResult() (ReadQuery) it is assumed to be non-transactional, and may use an auto-commit connection if you have specified a read connection pool, or are not using JTA.
If you execute the Query using executeUpdate() (DataModifyQuery) that it will be transactional.
If this is the case, then you can initiate a transaction either by call beginEarlyTransaction() or the UnitOfWork before executing the query,
em.unwrap(UnitOfWork.class).beginEarlyTransaction();
or, setting the query hint,
"eclipselink.exclusive-connection"="true"
should work
A flush (that results in DML) or DML execution will also have the same effect.
James : Wiki : Book : Blog : Twitter
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03035 seconds