-->
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: Strange Problems in hibernate with hsqldb
PostPosted: Fri Oct 30, 2009 12:56 pm 
Newbie

Joined: Tue Aug 25, 2009 11:41 am
Posts: 6
Hi everyone,

I am using hibernate with hsqldb and I am reading from a file and inserting them into the hsqldb tables. My problem is that everything goes fine but when I check the tables, the rows are not inserted. For example, when running my code the following console message appears:

Code:
Hibernate: insert into tbl_software (SOFTWARE_ID, SOFTWARE_NAME) values (null, ?)
Hibernate: call identity()


However, when I check the tbl_software, its empty. Another issue that is stranger still is that the insertion works when I try to do it in debug mode by setting some breakpoint even though I just run through them without changing any code.

Please help guys!!

Thanks


Top
 Profile  
 
 Post subject: Re: Strange Problems in hibernate with hsqldb
PostPosted: Mon Nov 02, 2009 5:12 am 
Newbie

Joined: Tue Aug 25, 2009 11:41 am
Posts: 6
Hi,

Still no replies... anybody out there come across the same problem?


Top
 Profile  
 
 Post subject: Re: Strange Problems in hibernate with hsqldb
PostPosted: Mon Nov 02, 2009 6:26 am 
Newbie

Joined: Fri Aug 14, 2009 7:32 am
Posts: 5
Hi,

You need to set auto commit true in hibernate configuration file.

<property name="connection.autocommit">true</property>

Regards,
Robert


Top
 Profile  
 
 Post subject: Re: Strange Problems in hibernate with hsqldb
PostPosted: Mon Nov 02, 2009 7:46 am 
Newbie

Joined: Tue Aug 25, 2009 11:41 am
Posts: 6
hi robert,

thanks for your reply. I tried your suggestion but still not working. I have pasted the relevant part of my configuration file below:
Code:
<hibernate-configuration>
   <session-factory>
      <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
      <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
      <property name="hibernate.connection.password"></property>
      <property name="hibernate.connection.url">jdbc:hsqldb:file:C:\easadb\easa</property>
      <property name="hibernate.connection.username">sa</property>
      <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
      <property name="hibernate.show_sql">true</property>
      <property name="current_session_context_class">thread</property>
      <property name="connection.autocommit">true</property>
                 ......
    </session-factory>
</hibernate-configuration>


the funny thing is on the console everything seems to be fine but the the transaction seems to be not committing to the database. please advise


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.