-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Commit delay / SPs
PostPosted: Wed Jun 09, 2004 3:09 pm 
Beginner
Beginner

Joined: Tue Feb 10, 2004 8:22 am
Posts: 28
Hi all!

I'm working with hibernate transactions and it's working very fine with the persistence of the objects.
Now I'm working also with Stored procedures, and the process is taking too much time to show the data into the DB(oracle 9i) for the SP.

- I'm openning transactions like this:

getSession().beginTransaction();


- Executing SP like this:

Connection conn = session.connection();
conn.setAutoCommit(false);
CallableStatement callStmt = conn.prepareCall(chamada);
stmt.executeUpdate();
stmt.close();

- the commit:

getTransaction().commit();

What could be the problem? I'm testing with a SP that just insert a register and it takes about 15 seconds. For the persistent objects is very fast.

Thanx.

_________________
Ricardo K. Costa


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 3:57 pm 
Beginner
Beginner

Joined: Tue Feb 10, 2004 8:22 am
Posts: 28
I think that the transaction is taking too long to close/commit.
I run the process and during the some time I can't see the register inserted and can't insert others... is it locking the table or something like?

_________________
Ricardo K. Costa


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2004 9:50 am 
Beginner
Beginner

Joined: Tue Feb 10, 2004 8:22 am
Posts: 28
And if I execute the commit like below, the information is written on the act of the command... very fast.

stmt.executeUpdate();
dt = stmt.getString(4);
stmt.getConnection().commit();

.....

It is the net.sf.hibernate.Transaction.commit() that is making it slow.
What should I do?

_________________
Ricardo K. Costa


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2004 2:02 pm 
Beginner
Beginner

Joined: Tue Feb 10, 2004 8:22 am
Posts: 28
I have another doubt that would probably solve the problem...
In the code I'm setting the connection to autoCommit(false) because when the SP executed and after was thrown an exception, the data stored in the SP wasn't rolled back.

My question is... using the connection obtained through the session, would it be in the same transaction of the session?

Somebody help me on this...

Thanks.

_________________
Ricardo K. Costa


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.