Getting 'generate could not read a hi value java.sql.SQLException Invalid object name 'hibernate_unique_key' SQLException Error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

Using SQL Server database, after migrating databases or restoring sql dumps under certain conditions, the following appears in the atlassian-confluence.log:

2009-06-02 14:26:42,223 ERROR [DefaultQuartzScheduler_Worker-1] [sf.hibernate.id.TableGenerator] generate could not read a hi value
java.sql.SQLException: Invalid object name 'hibernate_unique_key'.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
	at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
	at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:94)
	at com.atlassian.hibernate.ResettableTableHiLoGenerator.generate(ResettableTableHiLoGenerator.java:62)
...
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at $Proxy55.verify(Unknown Source)
	at com.atlassian.confluence.cluster.safety.ClusterSafetyJob.executeJob(ClusterSafetyJob.java:13)
	at com.atlassian.confluence.setup.quartz.AbstractClusterAwareQuartzJobBean.surroundJobExecutionWithLogging(AbstractClusterAwareQuartzJobBean.java:64)
...

原因

  1. The SQL Server database was created or recreated with tables with the incorrect case, either capital or lower-case.
  2. The schema name of Confluence database is not the default schema name which is dbo (MS SQL Server).
  3. The hibernate_unique_key table is empty and the next_hi column has a null value in it. 

ソリューション

  1. Check Database Setup for SQL Server to ensure that collation and case-sensitivity is configured correctly.
  2. Contact your database administrators and request to change the schema name to dbo. For reference see this link.
  3. Run the following query to confirm if the table is populated:

    SELECT max(next_hi) FROM hibernate_unique_key;
    

    If it returns a null instead of a numeric value, shut down you instance and run the following query:

    insert into hibernate_unique_key (next_hi) values (0);
    

 

 

 

 

 

 

最終更新日 2016 年 6 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.