Hi,
We have the following code in the after() method to save information to an
attribute, but we are getting errors shown below when we try to save.
FYI, we do have that attribute enabled for "unique", which I guess MAY be
causing that "Duplicate entry" error, but if that is the case, does that mean
that the attribute that is configured for "unique" can only be saved to once?
Also, in the 2nd stacktrace, notice the subject string that is shown ends with
", C=". That should actually be ending with ", C=US", i.e., the last 2
characters are being truncated. Why is that? Is there a really small maximum
length on that column? And, if so, how can we increase that?
21:20:25.483 ERROR
org.apache.syncope.core.provisioning.api.pushpull.SyncopeResultHandler - Could
not update USER fd4d7b4c-4387-46aa-8b84-0c1f52e16979
org.apache.openjpa.persistence.EntityExistsException: The transaction has been
rolled back. See the nested exceptions for details on the errors that occurred.
at
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2199)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1962)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at org.apache.openjpa.kernel.QueryImpl.isInMemory(QueryImpl.java:1028)
~[openjpa-kernel-3.1.0.jar:3.1.0]
.
.
.
Caused by: org.apache.openjpa.persistence.EntityExistsException: Duplicate
entry 'CN=user1, OU=People, ...., C=' for key 'U_PLNTQVL_STRINGVALUE'
{prepstmnt 273422954 INSERT INTO UPlainAttrUniqueValue (id, binaryValue,
booleanValue, dateValue, doubleValue, longValue, stringValue, ATTRIBUTE_ID,
schema_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)} [code=1062, state=23000]
at
org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5235)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:75)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:146)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:80)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:102)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:90)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:361)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flushGraph(ConstraintUpdateManager.java:353)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:101)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:61)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:108)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:81)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:757)
~[openjpa-jdbc-3.1.0.jar:3.1.0]
at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at
org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:679)
~[openjpa-kernel-3.1.0.jar:3.1.0]
at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:146)
~[openjpa-kernel-3.1.0.jar:3.1.0]
... 85 more
Thanks,
Jim