Forums Register Login

HibernateException

+Pie Number of slices to send: Send
In this code snippnet,
try {
Session session = new Configuration().configure().buildSessionFactory ().openSession();
session.beginTransaction();
Criteria crit = session.createCriteria(..);
List l = crit.list();
session.getTransaction().commit();
} catch(HibernateException e) {
..
}


Is it OK if I only catch the "HibernateException" ? Do I have to catch a "Exception" also ? I really don't see any other possible Exception besides "HibernateException" .. Please advise.
+Pie Number of slices to send: Send
 


I really don't see any other possible Exception besides "HibernateException"


What does the API say? It will tell you what checked exceptions can be thrown.
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 682 times.
Similar Threads
Hibernate+session
Help!!! Hibernate Transaction with Websphere
Trouble inserting with Hibernate2 and newer MySQL
Saving Data
Hibernate : Could not execute query -- Exception
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:56:48.