It's all about the answers!

Ask a question

RAM always throw database exception


pan tianming (4765644) | asked Feb 24 '11, 9:01 p.m.
We always meet the following exception when click an asset or community, after we restart RAM db, it can work well for several hours, then the problem occur again. The RAM version is 7.2, the details exception info like this:

Caused by: javax.faces.el.EvaluationException: Error getting property 'results' from bean of type pagecode.search.Index: com.ibm.ram.repository.core.IRepositoryAccess$RepositoryException: One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "3" constrains table "RAMSCHEMA.REPOSITORYMETRIC" from having duplicate values for the index key.
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:90)
at com.ibm.faces.databind.SelectItemsPropResolver.getValue(SelectItemsPropResolver.java:41)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:249)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:140)
... 57 more
Caused by: com.ibm.ram.repository.core.IRepositoryAccess$RepositoryException: One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "3" constrains table "RAMSCHEMA.REPOSITORYMETRIC" from having duplicate values for the index key.
at com.ibm.ram.repository.core.sdo.BaseRAMSchemaAccess.addMetric(BaseRAMSchemaAccess.java:10640)
at com.ibm.ram.repository.core.sdo.BaseRAMSchemaAccess.addMetric(BaseRAMSchemaAccess.java:10583)
at com.ibm.ram.repository.audit.ActivityManager.recordActivitySDO(ActivityManager.java:626)
at com.ibm.ram.repository.audit.ActivityManager.recordActivity(ActivityManager.java:667)
at com.ibm.ram.repository.assets.AssetManager.searchAssets(AssetManager.java:1057)
at com.ibm.ram.repository.assets.AssetManager.searchAssets(AssetManager.java:348)
at pagecode.search.Index.search(Index.java:424)
at pagecode.search.Index.getResults(Index.java:888)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:80)
... 62 more
Caused by: com.ibm.ram.repository.core.IRepositoryAccess$RepositoryException$RepositoryLinkedException: com.ibm.websphere.ce.cm.DuplicateKeyException: One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "3" constrains table "RAMSCHEMA.REPOSITORYMETRIC" from having duplicate values for the index key.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:525)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:580)
at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.mapException(WSJdbcUtil.java:909)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:600)
at com.ibm.ram.repository.core.sdo.BaseRAMSchemaAccess.addMetric(BaseRAMSchemaAccess.java:10636)
... 73 more
Caused by: com.ibm.db2.jcc.c.SqlException: One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "3" constrains table "RAMSCHEMA.REPOSITORYMETRIC" from having duplicate values for the index key.
at com.ibm.db2.jcc.c.fg.d(fg.java:1340)
at com.ibm.db2.jcc.b.gb.k(gb.java:351)
at com.ibm.db2.jcc.b.gb.a(gb.java:60)
at com.ibm.db2.jcc.b.w.a(w.java:52)
at com.ibm.db2.jcc.b.wb.c(wb.java:213)
at com.ibm.db2.jcc.c.gg.ab(gg.java:1779)
at com.ibm.db2.jcc.c.gg.d(gg.java:2324)
at com.ibm.db2.jcc.c.gg.X(gg.java:1332)
at com.ibm.db2.jcc.c.gg.execute(gg.java:1316)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:590)



Anybody know how to resolve REPOSITORYMETRIC this table error? Otherwise we can not click any asset when this issue happen. Thanks.

2 answers



permanent link
Rich Kulp (3.6k38) | answered Feb 25 '11, 10:38 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi,

Is your database a regular production database, or have done
re-populates of the data from SQL scripts?

This error usually means that

a) The AUTOKEYGEN.NEXT_METRIC column value was reset way too small.
b) Some how someone put a metric out that was larger than the value in
the NEXT_METRIC column.

In a normal production database the NEXT_METRIC value is ALWAYS larger
then the largest value of REPOSITORYMETRIC.ID in any row of that table.

If a database was repopulated by script it is possible this constraint
was broken.

--
Rich Kulp
Rational Asset Manager developer

permanent link
pan tianming (4765644) | answered Feb 28 '11, 2:00 a.m.
Hi Rich,

We found this problem and resolved it now. It is caused by another RAM server also link its database with the same one, so the data are always report error, thank you for your help.

Hi,

Is your database a regular production database, or have done
re-populates of the data from SQL scripts?

This error usually means that

a) The AUTOKEYGEN.NEXT_METRIC column value was reset way too small.
b) Some how someone put a metric out that was larger than the value in
the NEXT_METRIC column.

In a normal production database the NEXT_METRIC value is ALWAYS larger
then the largest value of REPOSITORYMETRIC.ID in any row of that table.

If a database was repopulated by script it is possible this constraint
was broken.

--
Rich Kulp
Rational Asset Manager developer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.