Open Session in Viewer (OSIV) and Sleep Session

Following is a hypothetical situation on Spring 3.x and Hibernate3.x

I have a service layer in Spring that calls 3 DAOs to build a model. DAOs are transactional (@Transactional) and have hibernate lazy loaded collections.
The service method calls multiple updates along with data retrieval.

A typical DAO method would be as follows:

public O create(I entity) throws GenericException {
    getOrCreateSession().save(entity);
    return (O)entity;
}

      

I have the following questions about OSIV -
1. How many times is this session cleared (database refresh) in AUTO mode by default?
2.Can OSIV need to be extended to extend the session in one request (per conversation)?

+3


source to share


1 answer


  • AUTO flush mode will execute pending DML assertions if:

    • the current transaction is committed.
    • when a query can target an entity table, the current allocated to clean up
  • Spring Webflow has long chain support .



+1


source







All Articles