Community
Participate
Working Groups
Build Identifier: 20100917-0705 When calling PLSQL function (Oracle 10.2.0.3.0) using EclipseLink StoredFunctionCall, EclipseLink is doing implicit commit after executeQuery finishes. I have no mechanisms of control to commit/rollback data that was changed during the PLSQL function execution (for example, if the returning value from executeQuery is unsatisfying. PLSQL function is inserting data in some test table. I'm using StoredFunctionCall for defining procedure, ValueReadQuery for defining query arguments, and JpaHelper.getEntityManager(entManager).getServerSession().executeQuery for calling function. The data is written in database on finishing executeQuery, before program finishes. Reproducible: Always Steps to Reproduce: 1. define StoredFunctionCall, ValueReadQuery arguments 2. call JpaHelper.getEntityManager(db.entManager).getServerSession().executeQuery(query, queryArgs) 3. test database, the plsql function inserted data, and implicit commit happened
Created attachment 179608 [details] java class which uses StoredFunctionCall this is the source of java class where StoredFunctionCall is being used
Created attachment 179609 [details] PLSQL function PLSQL function which is called by JPA and it inserts data
Setting target and priority. See the following page for details of the meanings of these: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
This is not a bug, your code is wrong. Executing using the ServerSession is always auto-committed. You need to execute in the EntityManager/UnitOfWork. Query query = db.entManager.unwrap(JpaEntityManager.class).createQuery(query);
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink