adplus-dvertising
frame-decoration

Question

Sessionfactory can manage contextual sessions for you and allows you to retrieve them by the:-

a.

getSession() method

b.

getCurrent() method

c.

getCurrentSession() method

d.

none of the mentioned

Answer: (c).getCurrentSession() method

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Sessionfactory can manage contextual sessions for you and allows you to retrieve them by the:-

Similar Questions

Discover Related MCQs

Q. DAO methods require access to the session factory, which can be injected:-

Q. DAO methods must be made transactional.

Q. Annotation to find a transaction and then fail, complaining that no Hibernate session been bound to the thread.

Q. In the bean configuration file for Hibernate (i.e., beans-hibernate.xml), you have to declare a HibernateTransactionManager instance for this application and enable declarative transaction via:-

Q. HibernateTemplate will translate the native Hibernate exceptions into exceptions in Spring DataAccessException hierarchy.

Q. Annotation for Hibernate exceptions to be translated into Spring DataAccessException for consistent exception handling:-

Q. Instance to translate the native Hibernate exceptions into data access exceptions in Spring DataAccessException hierarchy.

Q. You can assign a component name in this annotation and have the session factory autowired by the Spring IoC container with @Autowired.

Q. Spring provides to simplify your DAO implementation by managing entitymanagers and transactions for you:-

Q. Annotation used for entity manager injection in EJB components.

Q. To use the context injection approach, you can declare an entity manager field in your DAO and annotate it with the @PersistenceContext annotation.

Q. JpaTemplate will translate the native JPA exceptions into exceptions in Spring DataAccessException hierarchy.

Q. Transactions can be described with key properties:-

Q. To access a database running on the Derby server, you have to add:-

Q. Spring’s transaction support offers a set of technology-independent facilities, including transaction managers.

Q. Spring’s core transaction management abstraction is based on the interface:-

Q. The PlatformTransactionManager interface provides methods for working with transactions:

Q. Spring has several built-in implementations of PlatformTransactionManager interface for use with different transaction management APIs.

Q. A transaction manager is declared in the Spring IoC container as a normal bean.

Q. Method that allows you to start a new transaction (or obtain the currently active transaction).