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);