Domanda

I am having an issue while accessing single database instance using multiple/distributed Hibernate SessionFactories i.e. multiple instances of Hibernate SessionFactory. If I use one session factory to perform insert operation and create new SessionFactory to retrieve data from database without closing the former SessionFactory then I get "null". I have also tried to use multiple Second Level Cache Platforms but none resolved issues. Do reply if anyone have found any solution to this.

I am using MySql database and my the database engine chosen at installation time is Innodb. Thanks.

È stato utile?

Soluzione

After working over the issue and trying everything which could be done with hibernate I found no solutions to the issue. Then after I tried changing the database engine to MYISAM from the earlier Innodb which resolved issues of data not getting fetched and throwing NullPointerException.

I would like to know if somebody can tell why MYISAM worked and Innodb failed to work in distributed operations for insert followed by retrieval ?

Altri suggerimenti

MyISAM by default make autocommi=true. MYISAM is a pretty old engine. It is advisable to use INNODb storage engine and Make autocommit as true in hibernate properties file.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top