1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)
 

Recent Questions

!!! Hibernate Frequently Asked Questions !!!

Q.Transaction with plain JDBC in Hibernate ?

!!!Answer!!!- From Technical Expert

If you don't have JTA and don't want to deploy it along with your application, you will usually have to fall back to JDBC transaction demarcation. Instead of calling the JDBC API you better use Hibernate's Transaction and the built-in session-per-request functionality:

To enable the thread-bound strategy in your Hibernate configuration:

set hibernate.transaction.factory_class to org.hibernate.transaction.JDBCTransactionFactory
set hibernate.current_session_context_class to thread

Session session = factory.openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();

// Do some work
session.load(...);
session.persist(...);

tx.commit(); // Flush happens automatically
}
catch (RuntimeException e) {
tx.rollback();
throw e; // or display error message
}
finally {
session.close();
}

Answered By : null Replied Date : Feb 2 2014
Answer :


Answered By : null Replied Date : Jan 30 2014
Answer :


Answered By : null Replied Date : Dec 8 2013
Answer :


Answered By : null Replied Date : Oct 22 2013
Answer :


Answered By : Anil Replied Date : Sep 23 2013
Answer : dvkdjvndkjfvnd


Answered By : null Replied Date : Feb 6 2014
Answer :


Answered By : null Replied Date : Mar 1 2014
Answer :


Answered By : null Replied Date : Mar 5 2014
Answer :


Answered By : null Replied Date : Aug 15 2014
Answer :


Answered By : null Replied Date : Aug 19 2014
Answer :


Answered By : null Replied Date : Nov 14 2014
Answer :


Answered By : null Replied Date : Mar 7 2015
Answer :


Answered By : null Replied Date : Jun 14 2015
Answer :


Answered By : null Replied Date : Jul 8 2015
Answer :


Answered By : null Replied Date : Mar 21 2016
Answer :


Answered By : null Replied Date : Apr 9 2016
Answer :


Answered By : null Replied Date : Jun 21 2017
Answer :


 

You can also contribute to this answer:

Your Name:
Answer:

 
Ask Question and get answer from Expert.
View Answers List from Expert.

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy