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.  [ 1 post ] 
Author Message
 Post subject: joined-subclass and multiple threads.
PostPosted: Wed Jul 27, 2005 3:06 pm 
Newbie

Joined: Wed Jul 27, 2005 2:34 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:
<class name="Driver" table="driver">
<id name="deviceSerialNumber" type="java.lang.String" column="driver_serial_number" >
<generator class="assigned" />
</id>

<joined-subclass name="MyDriver" table="Mydrive" extends="Driver">
<key column="driver_serial_number" />

</joined-subclass>
</class>


Code between sessionFactory.openSession() and session.close():
public class TestObjLayer {
public static void main(String[] args) {
TestObjLayer.testThread("MS1302");
TestObjLayer.testThread("MS1303");
}

public static void testThread(final String barcode) {
new Thread() {
public void run() {

System.out.println("Starting thread ID ---"
+ Thread.currentThread().getName());
Session sess = factory.openSession();
Transaction tx;
try {
tx = sess.beginTransaction();
//update some field.
//update the object.
...
tx.commit();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally {
sess.close();
}
}
}.start();
}
}


Full stack trace of any exception that occurs:

Name and version of the database you are using: ingres r 3

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I have a joined-subclass relationship between 2 classes. When i use multiple threads to retrieve and save different objects simultaneously both the threads hang when they reach session.commit(). There is no exception. Finally i have to kill both the threads. There is definitely some dead lock condition, which I am not able to figure out.

Any help is greatly appreciated.
Thanks.


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

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.