I have created a small app. using SmartGWT 2.5 and Spring/Hibernate for persistence to support basic CRUD operations. When I attempt to create a new employee record, I can see the insert stmt. being constructed (format_sql is set to true in my ...cfg.xml file), but the record does not make it into the database and it appears that no SQL exceptions are being thrown.
I have the insert call coded as follows in my DAO:
Code:
Session hibernateSession = sessionFactory.openSession();
Transaction t = null;
try {
t=hibernateSession.beginTransaction();
hibernateSession.save(item)
t.commit()
} catch(Exception e) {
t.rollback()
} finally {
if (hibernateSession != null)
hibernateSession.close()
}
In the console, I see the following:
Hibernate:
insert into
TEST.EMP
(COMM, ENAME, HIREDATE, JOB, MGR, MGRNAME, SAL, EMPNO)
values
(?, ?, ?, ?, ?, ?, ?, ?)
hbm2ddl.auto is set to update
I am using annotations so the bean id class attribute for the "hibernateSessionFactory" is set to "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean".
Any ideas as to why the record is not being inserted?