anthony wrote:
Quote:
I am persisting my data to MS Access db,
I can query (find) with hibernate but I cant save,update or delete it.
below is the configuration file;
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">sun.jdbc.odbc.JdbcOdbcDriver</property>
<property name="hibernate.connection.url">
jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ=X:\OCR\data\ocrdb.mdb</property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="dialect">
net.sf.hibernate.dialect.MSAccessDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<property name=" hibernate.jdbc.batch_size">
10
</property>
<property name="hibernate.cache.provider_class">
net.sf.hibernate.cache.HashtableCacheProvider
</property>
<mapping resource="conf/persistence/Workflow.hbm.xml"/>
</session-factory>
</hibernate-configuration>
and this is how I retrieve data;
if (tasks == null) {
try {
tasks = persistenceSession.find(
"Select From Task");
}
catch (PersistenceException ex) {
DisplayManager.sharedInstance().displayErrorMessages(null, ex);
}
}
and this is how I try to save which doesnt generate insert query
HibernateTransaction transaction = persistenceSession.beginTransaction();
persistenceSession.insert(task);
transaction.commit();
Isnt that weird, I can retrive data but cant save any.