Hibernate version:
3.0 final.
Hi,
I am experiencing a problem whereby a native SQL exception does not execute. I have establised a java.sql.Connection by calling the Hibernate method, session.connection();. I then create a PreparedStatement from the connection and call executeUpdate() on it. Then the system just hangs indefinitely. I know this isn't really a Hibernate issue but it seems odd as regular JDBC works fine against the database. The only difference here is that I am establising the connection from the Hibernate session.
Has anyone else used this successfully? Perhaps there is something simple that I'm doing wrong.
Details below...
Mapping documents:
N/A
Code between sessionFactory.openSession() and session.close():
Code:
Session session = sessionFactory.openSession();
java.util.Date currentTime = new java.util.Date();
Connection c = session.connection();
PreparedStatement ps = c.prepareStatement("update USER set LAST_LOGIN = ? where USER_ID = ?");
ps.setDate(1, new java.sql.Date(currentTime.getTime()));
ps.setInt(iUserId);
log.debug("Executing statement...");
int iRowsUpdated = ps.executeUpdate();
log.debug(iRowsUpdated + " records updated in table USER");
session.disconnect();
session.close();
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
Oracle 8i