-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: No insert query generated
PostPosted: Fri Dec 17, 2004 7:43 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
Hi all,
I am persisting my data to MS Access db,
I can get data with find, but I cant save it
I called save and saveOrUpdate methods, nothing changed ,
moreover it doesnt throw any Exception.
What can be the reason behind that?

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 9:09 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
I am persisting my data to MS Access db,

how you do this? odbc / jdbc bridge?

show some code but i'm afraid access isn't really supported by hibernate, or 100% jdbc supported

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 9:34 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
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.

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 9:48 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
aha, this could be because of the

<property name="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>

?

select requires no transaction but save,delete or update requires,
can this be the reason behind not working of save,delete or update
and working of find?

I am in mess..

_________________
-developer


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.