Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT ACCESS
Hibernate identifier generation
Aendy
2007-12-18 06:56:05
I just upgraded to the newest version of HXTT Access (v3.0.010) and also downloaded the current hibernate support package. After everything worked fine with v2.1, I now get an exception, when trying to insert a record into the database (via Hibernate):

org.hibernate.HibernateException: The database returned no natively generated identity value
at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:33)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:74)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)


I am using java.lang.String identifiers and let hibernate chose the generator type. Using the old version a file named "hibernate_sequence.SEQ" was created automatically in the directory of the .mdb file when the Hibernate SessionFactory was created. The new version does not.

Please explain your changes around this point and suggest a clean way to generate string identifiers.

Thank you in advance.


Aendy
Re:Hibernate identifier generation
Aendy
2007-12-21 03:09:08
I'm a bit disappointed, that there is still no reaction to my question after more than two days. Nevertheless I digged around some more and achieved a better understanding of the problem.

Since July of this year you have changed the hibernate support package. The HXTT dialect now tells Hibernate, that HXTT supports identity columns. If you let hibernate automatically chose the identifier generation strategy, it will select the IdentityGenerator in case identity columns are supported.

Using this configuration all tables will be created with auto increment primary key columns. But any attempt to insert records into the database via hibernate will produce the exception shown above. The dialect method "getIdentitySelectString" might play a role in this game, maybe also other dialect methods. Unfortunately I'm not able to fix the problem myself, without knowldge of the internals of the HXTT JDBC driver implementation.

I really like to use auto increment primary columns with HXTT and hibernate's IdentityGenerator. Any suggestions?


Aendy
Re:Re:Hibernate identifier generation
HXTT Support
2007-12-21 17:19:12
>I'm a bit disappointed, that there is still no reaction to my question after more than two days.
Sorry. Because we're digging out that issue. Please download the latest package.

>If you let hibernate automatically chose the identifier generation strategy, it
>will select the IdentityGenerator in case identity columns are supported.
>The dialect method "getIdentitySelectString" might play a role in this game,
>maybe also other dialect methods.
Yeah. Because it seems that Hibernate hasn't distinguished identity column and sequence by two different methods, so that we have complemented try-failed-retry code to let HXTT Access can skip that issue. Please try the latest pacakge.

>The dialect method "getIdentitySelectString" might play a role in this game,
You can continue using your old code or try new feature. Thanks for your report.
Re:Re:Re:Hibernate identifier generation
Aendy
2007-12-30 09:16:37
Thanks for your response.

I have downloaded the new Access JDBC 3.0 Package and also the Hibernate Support Package, although this wasn't changed. Unfortunately the problem still remains. I am not able to use hibernate's IdentityGenerator. I still get the Exception shown above.

Please check. Thank you in advance.


Aendy

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap