Skip to main content

Posts

Showing posts from September 18, 2009

Hibernate Interview Questions

Q)What are the different Transaction Factories available with Hibernate? A) There are three types of Tx Factory available in hibernate JDBCTransactionFactory, JTATransactionFactory and CMTTransactionFactory. Q) Which one is the default transaction factory in Hibernate 3.2? A)JDBCTransactionFactory is the default local transaction factory withHibernate 3.2. Q)Can Hibernate Session Factory be bound to JNDI? A) Yes, by configuring in hibernate.cfg file, session factory can be bound to initial context (as defined by properties hibernate.jndi.url and hibernate.jndi.class). Example: You have to expose this property hibernate.session_factory_name= java:/hibernate/MySessionFactory in hibaernate.cfg file. hibernate.jndi.class = com.sun.jndi.fscontext.RefSContextFactory hibernate.jndi.url = file:/auction/jndi In side HibernateUtil class SessionFactory sf = (SessionFactory) new IntialContext().lookup("/hibernate/MySessionFactory") Q) Can Hibernate be used to call stored procedur...