From googles, it seems like a few people have had this problem before. I am getting an exception thrown on trying to persist an entity which has an ID with a GeneratedValue strategy of GenerationType.IDENTITY. (I was able to persist a test entity having the same fields, except for the ID). The error returned is:
ERROR: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the jConnect documentation.
I tried the suggested fix which was to run the JConnect script sql_server15.0.sql but it didn't help.
Any suggestions on how to fix this one?
The full stack trace:
ERROR: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the jConnect documentation. Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not prepare statement at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:196) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:122) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:89) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490) at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195) at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214) at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324) at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288) at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789) at com.adurosoft.hibernate.test.ReadMembers.main(ReadMembers.java:64) Caused by: java.sql.SQLException: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the jConnect documentation. at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(Unknown Source) at com.sybase.jdbc4.jdbc.MdaManager.getMetaDataAccessor(Unknown Source) at com.sybase.jdbc4.jdbc.SybDatabaseMetaData.getMetaDataAccessor(Unknown Source) at com.sybase.jdbc4.jdbc.SybDatabaseMetaData.getMetaDataAccessor(Unknown Source) at com.sybase.jdbc4.jdbc.SybDatabaseMetaData.getIdentityQuery(Unknown Source) at com.sybase.jdbc4.jdbc.SybStatement.processGenKeysRequest(Unknown Source) at com.sybase.jdbc4.jdbc.SybPreparedStatement.<init>(Unknown Source) at com.sybase.jdbc4.jdbc.SybConnection.prepareStatement(Unknown Source) at com.sybase.jdbc4.jdbc.SybConnection.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:124) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186) ... 21 more
|