Hi,
Oops, I forgot to include the code snippet that I was referring to:
// Store the 'SubjectString' value into the 'CertSubjectString' attrib in
Syncope realm...
UPlainAttr attr4Cert = entityFactory.newEntity(UPlainAttr.class);
attr4Cert.setOwner(outsideUser);
attr4Cert.setSchema(plainSchemaDAO.find("CertSubjectString"));
attr4Cert.add("cn=cert, ...., C=US",
anyUtilsFactory.getInstance(AnyTypeKind.USER));
outsideUser.add(attr4Cert);
userDAO.save(outsideUser);
I've been doing more testing, and I think that I had the cause-and-effect
reversed in my earlier message.
I originally thought that the truncation of the subject string was a
side-effect of the exception, but from the new testing I've done, it appears
that if the subject string is too long (maybe > 64 chars long?) that causes the
exception to occur.
I am recalling an earlier different problem we had which was caused by the
message column in the TaskExec table being too small. Is this problem similar,
i.e., is there some column in some Mysql table that cannot handle the longer
string?
Thanks,
Jim
On Tuesday, May 5, 2020, 05:46:43 PM EDT, <[email protected]> wrote:
FYI, that line is getting truncated at 64 characters...
Jim
On Tuesday, May 5, 2020, 05:36:41 PM EDT, <[email protected]> wrote:
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