Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326278 - Implicit commit using StoredFunctionCall
Summary: Implicit commit using StoredFunctionCall
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 04:35 EDT by Emil Egredzija CLA
Modified: 2022-06-09 10:30 EDT (History)
2 users (show)

See Also:


Attachments
java class which uses StoredFunctionCall (1.76 KB, text/plain)
2010-09-27 04:37 EDT, Emil Egredzija CLA
no flags Details
PLSQL function (529 bytes, text/plain)
2010-09-27 04:39 EDT, Emil Egredzija CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Egredzija CLA 2010-09-27 04:35:41 EDT
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
Comment 1 Emil Egredzija CLA 2010-09-27 04:37:55 EDT
Created attachment 179608 [details]
java class which uses StoredFunctionCall

this is the source of java class where StoredFunctionCall is being used
Comment 2 Emil Egredzija CLA 2010-09-27 04:39:41 EDT
Created attachment 179609 [details]
PLSQL function

PLSQL function which is called by JPA and it inserts data
Comment 3 Tom Ware CLA 2010-10-07 10:52:29 EDT
Setting target and priority.  See the following page for details of the
meanings of these:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 4 James Sutherland CLA 2011-03-10 10:58:50 EST
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);
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:16:36 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:30:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink