-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate load
PostPosted: Wed Feb 18, 2004 7:01 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all,

Im using hibernate 2.0.2 with Oracle 8.1.7.

I

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 8:34 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

I verified here that only one Serializable Object is locked table
into database.

What it can be happening?

thanks

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 10:35 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Just a guess:

Delimit the code with the transaction semantics as per the manual and try again. Let us know what the results are.

Code:
public Object load(Class c, Integer generatedId) throws Exception, ObjectNotFoundException
{
   Session session = session = factory.openSession();
   Transaction tx = null;
   try
   {
      tx = session.beginTransaction();
      return (Object) session.load(c, generatedId);
      tx.commit();
   }
   catch (Exception e)
   {
      if (tx != null) tx.rollback();
      throw e;
   }
   finally
   {
      session.close();
   }

   return o;
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 12:47 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi, thanks for help me!!!

Now, the object doesn

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 1:11 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Merci!!!!

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 3:56 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all again!!!!

I made the updates into method, using transaction, session,
and the table didn

_________________
Tads


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.