[jboss-jira] [JBoss JIRA] Commented: (JBID-74) org.hibernate.exception.ConstraintViolationException in updatePassword method.

Boleslaw Dawidowicz (JIRA) jira-events at lists.jboss.org
Wed Apr 1 05:05:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBID-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12459960#action_12459960 ] 

Boleslaw Dawidowicz commented on JBID-74:
-----------------------------------------

I hit this with mysql yesterday but suprisingly I was not seeing it with in memory hsqldb. Fixing...

> org.hibernate.exception.ConstraintViolationException in updatePassword method.
> ------------------------------------------------------------------------------
>
>                 Key: JBID-74
>                 URL: https://jira.jboss.org/jira/browse/JBID-74
>             Project: JBoss Identity
>          Issue Type: Bug
>          Components: IDM
>    Affects Versions: 1.0.0.alpha2
>            Reporter: Jeff Yu
>            Assignee: Boleslaw Dawidowicz
>
> I was trying to invoke the 'updatePassword' to update the existed password, and then it throws following exception.
> I've added following two lines in the 'idm-maven2-example/DBTestCase',
>       identitySession.getAttributesManager().updatePassword(eva, "oldPassword");
>       identitySession.getAttributesManager().updatePassword(eva, "newPassword");
> org.hibernate.exception.ConstraintViolationException: could not insert: [org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential]
> 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
> 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> 	at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:64)
> 	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)
> 	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)
> 	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
> 	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
> 	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
> 	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
> 	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
> 	at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
> 	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
> 	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
> 	at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)
> 	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)
> 	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
> 	at $Proxy30.persist(Unknown Source)
> 	at org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl.updateCredential(HibernateIdentityStoreImpl.java:1731)
> 	at org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository.updateCredential(WrapperIdentityStoreRepository.java:263)
> 	at org.jboss.identity.idm.impl.api.session.managers.AttributesManagerImpl.updatePassword(AttributesManagerImpl.java:316)
> 	at org.jboss.identity.idm.example.DBTestCase.testJBossIdentity(DBTestCase.java:90)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_60 in statement [insert into identity_obj_credential (id, BINARY, IDENTITY_ID, TEXT, IDENTITY_TYPE) values (null, ?, ?, ?, ?)]
> 	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
> 	at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
> 	at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
> 	... 41 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list