Hello. I am using hibernate 2.1.8 with Oracle 9.2.0.6
I get this warning: "-afterTransactionCompletion() was never called"
when I use a hibernate session to do query directly to Oracle (without a mapping)
the code looks as follows:
......
aSession = getSession();
qry = tcu.traduciParaXmlType(queryIngresado);
sb.append(
"select documento, guid, nombretribunal, partes, fechasentencia from "
+ xmlTable
+ " where"
+ " "
+ qry
+ " order by fechasentencia desc");
stmt =(OraclePreparedStatement) aSession.connection().prepareStatement(sb.toString());
rs = (OracleResultSet) stmt.executeQuery();
DocumentoDTO docDTO;
while (rs.next()) {
docDTO =
new DocumentoDTO(
rs.getLong(1),
rs.getString(2),
"Jurisprudencia",
rs.getString(3)
+ " - "
+ rs.getString(4)
+ " - "
+ rs.getDate(5).toString());
al.add(docDTO);
}
rs.close();
stmt.close();
....
It gives me this warning in the first execution of this while loop (first row it gets), one warning per rs.getXXX. The remaining iterations (rows) don´t throw any warning. We close the session after querying. I tried using session.flush() and session.clear() before iterating the resultset . session.flush() works sometimes, I guess it fails because we are using this session in other part of the code. Adding session.flush in every plausible place doesn´t work either in all cases.
It seems to be working fine (no warning) when querying via hibernate (using a mapping).
Any ideas how to work around this warning. We have in production the same code but with hibernate 2.0 final and we get no warning.
Thank you in advance for your help. Mariano
|