That's it!! I did not make the connection that the Map key data type needs to match the column data type. I don't know what I was thinking...
Anyway, I got this output...
[java] .Hibernate: select hibernate_sequence.nextval from dual
[java] Hibernate: insert into UL_COMMON_LOG_EVENT (observed_time, version, situation, message,
status, severity, log_level, address_type, address_name, component_name, application_name, instance_
name, thread_name, environment_name, cle_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[java] Hibernate: insert into UL_SITUATION_DATA (cle_id, sd_id, map_data) values (?, ?, ?)
[java] Hibernate: insert into UL_CORRELATION_DATA (cle_id, cd_id, map_data) values (?, ?, ?)
[java] Time: 2.324
[java] OK (1 test)
However, nothing was persisted to the database. Here is the code snippet for my implementation...
public void save(CommonLogEvent cle) {
Session session = null;
try {
session = sessionFactory.openSession();
session.save(cle);
session.flush();
} catch (HibernateException ex) {
ex.printStackTrace();
//handle exception
} finally {
close(session);
}
}
private void close(Session session) {
if (session != null) {
try {
session.close();
} catch (Exception ex) {
ex.printStackTrace();
//@TODO: handle exception
}
}
}
What could cause the data not to appear? Could this be a commit issue? I thought JDBC was auto-commit by default.
|