-->
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: Transaction and Spring
PostPosted: Wed Dec 01, 2010 7:02 pm 
Newbie

Joined: Wed Sep 30, 2009 2:08 pm
Posts: 3
I think I have everything defined correctly. However I am receiving a "Lock wait timeout exceeded: try restarting transaction" after trying to saveOrUpdate on multiple instances of the same object. I have myObjectDao being injected correctly and based on the exception it appears transactions are being started. Any ideas? Did I miss a setting? Psuedo-code is below.

Code:
public Class MyObjectDao {

@Transactional
public void save(T obj) {
getSession().saveOrUpdate(obj);
}


This is being run from a class with a main since this is a console app.
Code:
MyObject a = new MyObject();
MyObject b = new MyObject();

// inject myObjectDao

myObjectDao.save(a);
myObjectDao.save(b);


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.