So you are just setting a lock on an object? and it is just that line?
getHibernateTemplate().lock(instance, LockMode.NONE);
What do you need the lock for?
I must apologize, I do not use Spring, so I am not familiar with their framework.
for persist I usually have code like the following
Session session = sessionFactory.getSession();
Transaction t = session.beginTransaction();
MyObject m = new MyObject(blah blah blah, set up data);
session.saveOrUpdate(m);
t.commit()
All within a try-catch-finally where I clean up. Now with JPA the code is a little simpler with the EntityManager being injected, and if I was using EJB3 Stateless Sessio bean then I would just have
SOme transaction annotation then
Not that that really helps.
Mark