Hi
My problem is that the log looks o.k. with insert statement and commit, but nothing is written to the DB. No exceptions occur. The DB is created with lck, log, script, and properties file. I can open the DB, but it's empty.
Hibernate version: 3.1.2
Code between sessionFactory.openSession() and session.close():
Code:
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
ProductCategory theCategory = new ProductCategory();
theCategory.setIntlKey(intlKey);
theCategory.setActive(active);
theCategory.setOrder(order);
theCategory.setActiveFrom(activeFrom);
theCategory.setActiveUntil(activeUntil);
session.save(theCategory);
session.getTransaction().commit();
} catch (HibernateException e) {
if (tx != null) tx.rollback();
e.printStackTrace();
}
finally {
session.close();
}
Full stack trace of any exception that occurs: no exceptions
Name and version of the database you are using: HSQL 1.8.0.1
The generated SQL (show_sql=true): (from log excerpt below)
Code:
drop table CATEGORY if exists
create table CATEGORY (ID bigint generated by default as identity (start with 1), INTL_KEY varchar(8) not null, D_ORDER integer, IS_ACTIVE char(1), FROM_DATE date, TILL_DATE date, primary key (ID))
insert into CATEGORY (INTL_KEY, D_ORDER, IS_ACTIVE, FROM_DATE, TILL_DATE, ID) values (?, ?, ?, ?, ?, null)
commit
Debug level Hibernate log excerpt:Code:
23:26:07,187 INFO SchemaExport:155 - Running hbm2ddl schema export
23:26:07,187 DEBUG SchemaExport:173 - import file not found: /import.sql
23:26:07,187 INFO SchemaExport:182 - exporting generated schema to database
23:26:07,187 DEBUG SchemaExport:296 - drop table CATEGORY if exists
23:26:07,187 DEBUG SchemaExport:296 - create table CATEGORY (ID bigint generated by default as identity (start with 1), INTL_KEY varchar(8) not null, D_ORDER integer, IS_ACTIVE char(1), FROM_DATE date, TILL_DATE date, primary key (ID))
23:26:07,187 INFO SchemaExport:202 - schema export complete
23:26:07,234 DEBUG JDBCTransaction:54 - begin
23:26:07,234 DEBUG JDBCTransaction:59 - current autocommit status: false
23:26:07,250 DEBUG SQL:346 - insert into CATEGORY (INTL_KEY, D_ORDER, IS_ACTIVE, FROM_DATE, TILL_DATE, ID) values (?, ?, ?, ?, ?, null)
Hibernate: insert into CATEGORY (INTL_KEY, D_ORDER, IS_ACTIVE, FROM_DATE, TILL_DATE, ID) values (?, ?, ?, ?, ?, null)
23:26:07,265 DEBUG StringType:79 - binding 'bouquets' to parameter: 1
23:26:07,265 DEBUG IntegerType:79 - binding '1' to parameter: 2
23:26:07,265 DEBUG YesNoType:79 - binding 'true' to parameter: 3
23:26:07,265 DEBUG DateType:79 - binding '12 April 2006' to parameter: 4
23:26:07,265 DEBUG DateType:79 - binding '12 April 2006' to parameter: 5
23:26:07,265 DEBUG SQL:346 - call identity()
Hibernate: call identity()
23:26:07,281 DEBUG JDBCTransaction:103 - commit
23:26:07,281 DEBUG JDBCTransaction:116 - committed JDBC Connection
23:26:07,281 INFO SessionFactoryImpl:728 - closing
23:26:07,281 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:hsqldb:C:/Data/HSQL/blumenb