Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory
name="ids/net/sf/hibernate/SessionFactory">
<property name="hibernate.default_schema">ABCWIP</property>
<property
name="hibernate.connection.url">
jdbc:db2://XYZ-E302231:50000/WIP</property>
<property
name="hibernate.connection.username">db2_user</property>
<property
name="hibernate.connection.password">db2_user</property>
<property
name="hibernate.connection.driver_class">
com.ibm.db2.jcc.DB2Driver</property>
<property
name="hibernate.connection.pool_size">3</property>
<property
name="hibernate.dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property
name="hibernate.use_outer_join">true</property>
<property
name="hibernate.cache.use_query_cache">true</property>
<mapping
resource="com/lng/ids/repository/Activity.xml" />
<mapping
resource="com/lng/ids/repository/Agent.xml" />
<mapping
resource="com/lng/ids/repository/Applicant.xml" />
<mapping
resource="com/lng/ids/repository/AutoAccidentConviction.xml" />
<mapping
resource="com/lng/ids/repository/AutoClueClaim.xml" />
<mapping
resource="com/lng/ids/repository/AutoClueIncident.xml" />
<mapping
resource="com/lng/ids/repository/AutoClueReport.xml" />
<mapping
resource="com/lng/ids/repository/AutoCostNew.xml" />
<mapping
resource="com/lng/ids/repository/AutoCoverage.xml" />
<mapping
resource="com/lng/ids/repository/AutoDriver.xml" />
<mapping
resource="com/lng/ids/repository/AutoDriverMvr.xml" />
<mapping
resource="com/lng/ids/repository/AutoInputCoverage.xml" />
<mapping
resource="com/lng/ids/repository/AutoLnwPolicy.xml" />
<mapping
resource="com/lng/ids/repository/AutoLob.xml" />
<mapping
resource="com/lng/ids/repository/AutoLoss.xml" />
<mapping
resource="com/lng/ids/repository/AutoRating.xml" />
<mapping
resource="com/lng/ids/repository/AutoUwQuestionAnswer.xml" />
<mapping
resource="com/lng/ids/repository/AutoVehicle.xml" />
<mapping
resource="com/lng/ids/repository/AutoVehicleAddInterest.xml" />
<mapping
resource="com/lng/ids/repository/CoApplicant.xml" />
<mapping
resource="com/lng/ids/repository/FilenetUw.xml" />
<mapping
resource="com/lng/ids/repository/FilenetAgentUw.xml" />
<mapping
resource="com/lng/ids/repository/IbsReasonCode.xml" />
<mapping
resource="com/lng/ids/repository/InsuranceBureauScore.xml" />
<mapping
resource="com/lng/ids/repository/Notation.xml" />
<mapping
resource="com/lng/ids/repository/Policy.xml" />
<mapping
resource="com/lng/ids/repository/PolicyExtendedStatus.xml" />
<mapping
resource="com/lng/ids/repository/PolicyPdfForm.xml" />
<mapping
resource="com/lng/ids/repository/PolicyRating.xml" />
<mapping
resource="com/lng/ids/repository/Quote.xml" />
<mapping
resource="com/lng/ids/repository/QuoteExtendedStatus.xml" />
<mapping
resource="com/lng/ids/repository/QuotePdfForm.xml" />
<mapping
resource="com/lng/ids/test/repository/TestData.xml" />
<mapping
resource="com/lng/ids/test/repository/TestDataCache.xml" />
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
private Iterator findThings(String query)
throws RepositoryQueryException
{
Iterator results = null;
Session session = null;
try {
session = factory.openSession();
results = session.find(query).iterator();
} catch (Exception e) {
log.warn(HB_QUERY_MSG, e);
throw new RepositoryQueryException(HB_QUERY_MSG, e);
} finally {
try {
if (session != null) session.close();
} catch (HibernateException ignoredHibernateException) {
log.warn(HB_SESSION_MSG, ignoredHibernateException);
} catch (Exception ignoredException) {
log.warn(HB_SESSION_MSG, ignoredException);
}
}
return results;
}
Full stack trace of any exception that occurs:
[7/8/05 13:17:57:662 CDT] 15771a JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: null [7/8/05 13:17:57:665 CDT] 15771a JDBCException E net.sf.hibernate.util.JDBCExceptionReporter java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
[7/8/05 13:17:57:667 CDT] 15771a JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: null [7/8/05 13:17:57:668 CDT] 15771a JDBCException E net.sf.hibernate.util.JDBCExceptionReporter java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
[7/8/05 13:17:57:669 CDT] 15771a JDBCException E net.sf.hibernate.util.JDBCExceptionReporter Cannot close connection
[7/8/05 13:17:57:671 CDT] 15771a JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged com.ibm.db2.jcc.a.SqlException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed. at com.ibm.db2.jcc.a.o.r(o.java:1260) at com.ibm.db2.jcc.a.o.u(o.java:1285) at com.ibm.db2.jcc.a.o.s(o.java:1270) at com.ibm.db2.jcc.a.o.close(o.java:1253) at net.sf.hibernate.connection.DriverManagerConnectionProvider.closeConnection
Name and version of the database you are using:
com.ibm.db2.jcc.DB2Driver
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Could you please give me the reason behind these Hibernate exceptions. These exceptions have been resulting in a slow performance in the application.