java - org.hibernate.exception.LockAcquisitionException -


I know this question has been asked many times on the StackoverVarFfl but I see how it would be in my code is? Where should I look for a change in my code?

Ignore the fancy declaration of the session and the hibernate configuration I know how to create a database connection.

  Public Zero column (MyClass m) {MyClass updated MyClass = MyMethod (m); Session session = sessionFactory.open session (); Transaction Transactions = session.beginTransaction (); Session.saveOrUpdate (updatedMyClass); Transaction.commit (); Session.close (); } Public MyClass MyMethod (MyClass m) {session session = sessionFactory.openSession (); MyClass objMyClass = (MyClass) session.get (MyClass.class, m.getId ()); ..... objMyClass.setSomething (...); ..... session.close (); Return objMyClass; }  

I'm interested in ...

  • Why is this happening?
  • session .get uses that lock mode?
  • session.close () Issue all the lock for that database connection session?

Reference:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -