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.Difference between session.update() and session.lock() in Hibernate ?

!!!Answer!!!- From Technical Expert

Both of these methods and saveOrUpdate() method are intended for reattaching a detached object.
The session.lock() method simply reattaches the object to the session without checking or updating the database on the assumption that the database in sync with the detached object.
It is the best practice to use either session.update(..) or session.saveOrUpdate().
Use session.lock() only if you are absolutely sure that the
detached object is in sync with your detached object or if it does not matter because
you will be overwriting all the columns that would have changed later on within the same transaction.

Each interaction with the persistent store occurs in a new Session. However, the same persistent instances are reused for each interaction with the database. The application manipulates the state of detached instances originally loaded in another Session and then "reassociates" them using Session.update() or Session.saveOrUpdate().

// foo is an instance loaded by a previous Session
foo.setProperty("bar");
session = factory.openSession();
session.saveOrUpdate(foo);
session.flush();
session.connection().commit();
session.close();
You may also call lock() instead of update() and use LockMode.READ (performing a version check, bypassing all caches) if you are sure that the object has not been modified.

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


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


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


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


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


Answered By : null Replied Date : Nov 26 2013
Answer :


Answered By : null Replied Date : Nov 17 2013
Answer :


Answered By : null Replied Date : Nov 3 2013
Answer :


Answered By : null Replied Date : Nov 2 2013
Answer :


Answered By : null Replied Date : Nov 2 2013
Answer :


Answered By : null Replied Date : Nov 2 2013
Answer :


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Answered By : null Replied Date : Apr 7 2014
Answer :


Answered By : lll Replied Date : Apr 14 2014
Answer : jklkjkj


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


Answered By : null Replied Date : Apr 26 2014
Answer :


Answered By : null Replied Date : Apr 28 2014
Answer :


Answered By : null Replied Date : May 9 2014
Answer :


Answered By : null Replied Date : May 16 2014
Answer :


Answered By : null Replied Date : May 25 2014
Answer :


Answered By : null Replied Date : May 26 2014
Answer :


Answered By : null Replied Date : Jun 7 2014
Answer :


Answered By : null Replied Date : Jun 7 2014
Answer :


Answered By : null Replied Date : Jul 3 2014
Answer :


Answered By : null Replied Date : Jul 26 2014
Answer :


Answered By : null Replied Date : Jul 28 2014
Answer :


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


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


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


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


Answered By : null Replied Date : Sep 24 2014
Answer :


Answered By : null Replied Date : Sep 27 2014
Answer :


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Answered By : null Replied Date : Dec 4 2014
Answer :


Answered By : null Replied Date : Dec 9 2014
Answer :


Answered By : null Replied Date : Dec 9 2014
Answer :


Answered By : null Replied Date : Dec 17 2014
Answer :


Answered By : null Replied Date : Dec 20 2014
Answer :


Answered By : null Replied Date : Dec 20 2014
Answer :


Answered By : null Replied Date : Dec 21 2014
Answer :


Answered By : null Replied Date : Dec 21 2014
Answer :


Answered By : null Replied Date : Dec 21 2014
Answer :


Answered By : null Replied Date : Dec 25 2014
Answer :


Answered By : null Replied Date : Dec 29 2014
Answer :


Answered By : null Replied Date : Jan 3 2015
Answer :


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


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


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


Answered By : null Replied Date : Jan 17 2015
Answer :


Answered By : null Replied Date : Jan 27 2015
Answer :


Answered By : null Replied Date : Jan 29 2015
Answer :


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


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


Answered By : null Replied Date : Apr 4 2015
Answer :


Answered By : null Replied Date : Apr 13 2015
Answer :


Answered By : null Replied Date : Apr 13 2015
Answer :


Answered By : null Replied Date : Apr 20 2015
Answer :


Answered By : null Replied Date : Apr 22 2015
Answer :


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


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


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


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


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


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


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


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


Answered By : null Replied Date : Sep 6 2015
Answer :


Answered By : null Replied Date : Sep 6 2015
Answer :


Answered By : null Replied Date : Sep 30 2015
Answer :


Answered By : null Replied Date : Oct 4 2015
Answer :


Answered By : null Replied Date : Nov 12 2015
Answer :


Answered By : null Replied Date : Nov 12 2015
Answer :


Answered By : null Replied Date : Jan 16 2016
Answer :


Answered By : null Replied Date : Jan 18 2016
Answer :


Answered By : null Replied Date : Jan 22 2016
Answer :


Answered By : null Replied Date : Jan 23 2016
Answer :


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


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


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


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


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


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


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


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


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


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


Answered By : null Replied Date : Jun 1 2016
Answer :


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


Answered By : null Replied Date : Jun 11 2016
Answer :


Answered By : null Replied Date : Aug 13 2016
Answer :


Answered By : null Replied Date : Aug 18 2016
Answer :


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


Answered By : null Replied Date : Sep 29 2016
Answer :


Answered By : null Replied Date : Sep 29 2016
Answer :


Answered By : null Replied Date : Sep 29 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Oct 1 2016
Answer :


Answered By : null Replied Date : Oct 1 2016
Answer :


Answered By : null Replied Date : Oct 27 2016
Answer :


Answered By : null Replied Date : Nov 11 2016
Answer :


Answered By : null Replied Date : Jan 17 2017
Answer :


Answered By : null Replied Date : Jan 22 2017
Answer :


Answered By : null Replied Date : Jan 29 2017
Answer :


Answered By : null Replied Date : Mar 27 2017
Answer :


Answered By : null Replied Date : Mar 31 2017
Answer :


Answered By : null Replied Date : Apr 1 2017
Answer :


Answered By : null Replied Date : Apr 4 2017
Answer :


Answered By : null Replied Date : Apr 6 2017
Answer :


Answered By : null Replied Date : Apr 8 2017
Answer :


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


Answered By : null Replied Date : Jun 10 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