Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Stored Procedure call - Autocommit behavior
Stored Procedure call - Autocommit behavior [message #523845] Mon, 29 March 2010 06:28 Go to previous message
Thomas Haskes is currently offline Thomas Haskes
Messages: 142
Registered: July 2009
Senior Member
Hi all,

I'm calling a stored procedure that changes some data in the database
using the following code, and i noticed that the procedure call the way
I use it does a commit after being executed. The problem is that I dont
want the session to be autocommitted at all. How can I achieve that?
Here is the code I use:

JpaEntityManager jpaEm = JpaHelper.getEntityManager(tm.getEntityManager());
Session session = jpaEm.getActiveSession();
StoredProcedureCall procedureCall = new StoredProcedureCall();
procedureCall.addNamedArgument("Blabla", "Blabla", String.class);
DataReadQuery query = new DataReadQuery();
query.setCall(procedureCall);
ArrayList<Object> args = new ArrayList<Object();
query.addArgument("Blabla");
args.add("SomeValue");
session.executeQuery(query, args);


Besides: Is it possible to have EL decide whether data is manipulated in
the procedure and, if so, throw an Exception when outside of a transaction?

Thanks in advance

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:PreUpdate not working
Next Topic:Unexplained Update Statements affecting Concurrency
Goto Forum:
  


Current Time: Mon May 20 13:59:01 EDT 2013

Powered by FUDForum. Page generated in 0.01776 seconds