Setting up – HP Integrity NonStop J-Series User Manual
Page 98

Session s = sf.openSession();
Query q = s.createSQLQuery("select * frm address");
try {
List s2 = q.list();
} catch (HibernateException e) {
// Customers must get the corresponding SQL Exception using getCause().
If they want to build recovery mechanism, then the Customer must have
SQLMX specific error codes compared with error code in the SQLException
object embedded in HibernateException which will make the hibernate code
SQLMX specific.
}
When the converter is implemented then,
try {
List s2 = q.list();
}
catch (JDBCConnectionException e)
{
//Connection specific recovery code.
//May be a Connection retry
}
catch (ConstraintViolationException e)
{
//Constraints specific recovery
}
catch (GenericJDBCException e)
{
//general jdbc error recovery
}
catch (HibernateException e1) {
//Handle any hibernate exception.
}
Setting up Sample Hibernate Applications on NonStop
The sample applications (Caveat Emptor and the Event Manager Web Application) are included
in the SAMPLES.zip file in the Hibernate distribution, and require modifications to make them
compatible with NonStop systems.
98
Hibernate Framework