Vote count:
0
I'm trying to save an entity
protected void initRequest(T data) {
Request request = new Request();
data.setPosRequest(request);
request.setTimeStamp(new DateTime());
request.setType(REQUEST);
Session session = sessionFactory.getCurrentSession();
session.save(request);
logger.info("Newly created request: {}", request);
}
protected List<Request> getRequests(){
return (List<Request>) sessionFactory.
getCurrentFactory().
createQuery("from Requests").
list();
}
This methods are called from spring transactional context
@Transactional(noRollbackFor=Exception.class, propagation=Propagation.REQUIRES_NEW)
public void run() {
.
.
initRequest(data);
.
.
if (data.areRequestsNeeded()){
List<Request> requests = getRequests();
}
}
Transaction begun and is committed without any problems, but the problem is that the created lock is not still released even after Hibernate session is closed and it causes problems when I want to select data from that table
I'm using Spring 4.0.1., Hibernate 4, Derby 10.10.1.1.
Does the Hibernate session closing release locks? How is it working?
asked 1 min ago
Closing session does not release lock on table - Hibernate, Derby
Aucun commentaire:
Enregistrer un commentaire