persistence exception

296 views
Skip to first unread message

Paul Pettit

unread,
Sep 27, 2016, 1:12:26 PM9/27/16
to us...@opencast.org
Hi All,

Using 2.2.2 on a multi server setup using mysql, I am getting a lot of
the following errors in the logs on all servers. Everything appears to
be working fine though. Any ideas what I am doing wrong?

Many thanks,

Paul.

2016-09-27 17:59:17,421 | WARN | (JavaLog:289) -
Exception [EclipseLink-5006] (Eclipse Persistence Services -
2.6.0.v20150309-bf26070):
org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object
[org.opencastproject.job.jpa.JpaJob@3207148f] cannot be updated because
it has changed or been deleted since it was last read.
Class> org.opencastproject.job.jpa.JpaJob Primary Key> 24,066
at
org.eclipse.persistence.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating(OptimisticLockException.java:144)
at
org.eclipse.persistence.descriptors.VersionLockingPolicy.validateUpdate(VersionLockingPolicy.java:790)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1086)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:803)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1790)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:273)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:131)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4260)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:278)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169)[95:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:134)[96:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.updateInternal(ServiceRegistryJpaImpl.java:926)[169:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl$JobDispatcher.dispatchJob(ServiceRegistryJpaImpl.java:2935)[169:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl$JobDispatcher.run(ServiceRegistryJpaImpl.java:2857)[169:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_111]
at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_111]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_111]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_111]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_111]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_111]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_111]
2016-09-27 17:59:32,567 | WARN | (JavaLog:289) -
Exception [EclipseLink-5006] (Eclipse Persistence Services -
2.6.0.v20150309-bf26070):
org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object
[org.opencastproject.job.jpa.JpaJob@3766d6ff] cannot be updated because
it has changed or been deleted since it was last read.
Class> org.opencastproject.job.jpa.JpaJob Primary Key> 24,241
at
org.eclipse.persistence.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating(OptimisticLockException.java:144)
at
org.eclipse.persistence.descriptors.VersionLockingPolicy.validateUpdate(VersionLockingPolicy.java:790)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1086)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:803)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1790)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:273)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:131)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4260)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:278)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169)[81:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:134)[82:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.updateInternal(ServiceRegistryJpaImpl.java:926)[155:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl$JobDispatcher.dispatchJob(ServiceRegistryJpaImpl.java:2935)[155:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl$JobDispatcher.run(ServiceRegistryJpaImpl.java:2857)[155:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_111]
at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_111]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_111]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_111]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_111]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_111]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_111]

Karen Dolan

unread,
Sep 27, 2016, 2:07:52 PM9/27/16
to us...@opencast.org
Paul,

OptimisticLockExceptions usually always happen because the normal optimistic expectation that everything would go well was blackened by something unexpectedly bad that happened just before the optimistic lock exception.

Look for clues in the log above this error. The text might be something really subtle like "...unable to..", "..failed to..", "...this should never happen..", "..you should never get to here..", "..reverting..", "..rolling back..", "... a 400 pound hacker, run away!" something like that.

You may need to up your log level to DEBUG level log if you get this a lot and need more context about what is going on.

- Karen
> --
> You received this message because you are subscribed to the Google Groups "Opencast Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.
>
>

Karen Dolan

unread,
Sep 27, 2016, 2:53:19 PM9/27/16
to Opencast Users
Paul,

It could also be that another node updated an object and persisted the update at the same time that a different node had a handle on an object and also tried to update the object.
The second node would get an optimistic lock because it didn’t expect anything else to update the same object before it got a change to update it.

In that case, you probably won’t see errors in any of the logs, but you should see two nodes working on the same workflow or object at the same time.

- Karen


> Begin forwarded message:

stefanos

unread,
Sep 28, 2016, 2:55:44 AM9/28/16
to us...@opencast.org
Hi Paul
hi Karen,

we have same errors also

2016-09-28 08:45:30,945 | WARN | (JavaLog:289) -
Exception [EclipseLink-5006] (Eclipse Persistence Services -
2.6.0.v20150309-bf26070):
org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object
[org.opencastproject.job.jpa.JpaJob@168684db] cannot be updated because
it has changed or been deleted since it was last read.
Class> org.opencastproject.job.jpa.JpaJob Primary Key> 5,953
at
org.eclipse.persistence.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating(OptimisticLockException.java:144)
at
org.eclipse.persistence.descriptors.VersionLockingPolicy.validateUpdate(VersionLockingPolicy.java:790)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1086)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)[93:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]

Regards
Stefanos

Dietmar Zenker

unread,
Sep 28, 2016, 3:11:55 AM9/28/16
to Opencast Users

Hi all,

we have this error messages - i.e. these are only warnings... - too. Though this does not seem to have any implications for Opencast function: is there a way to get rid of these messages (via configuration)?

Greetings,
Dietmar

Karen Dolan

unread,
Sep 28, 2016, 8:28:40 AM9/28/16
to us...@opencast.org
Hi Dietmar,

> we have this error messages - i.e. these are only warnings... - too. Though this does not seem to have any implications for Opencast function: is there a way to get rid of these messages (via configuration)?

I don't know enough about OC2.2x to know if this OptimisticLock exception is Ok to be caught and ignored. If it is, it would be nice to add an INFO log "OptimisticLock collision occurred when persisting update of org.opencastproject.job.jpa.JpaJob Primary Key 5,953. Another process has already updated or deleted that job."

We get OptimisticLockExceptions in OC 1.6x when a child process causes a job to be deleted. The parent process tries to update a job that no longer exists. We don't worry too much about that because its uncommon for the child process to fail.

The concern is if the OptimisticLockException happens in a thread that has updated the service index, or sent an update message, and is trying to persist the new job state. Then the index will be out of synch with the database.

- Karen

Lars Kiesow

unread,
Sep 28, 2016, 8:36:23 AM9/28/16
to us...@opencast.org
Hi Karen,
if I am informed correctly, the relevant code and the cause of these
OptimisticLockExceptions has not changed between 1.x and 2.x.
–Lars

Karen Dolan

unread,
Sep 28, 2016, 8:39:51 AM9/28/16
to us...@opencast.org
Lars,


> if I am informed correctly, the relevant code and the cause of these
> OptimisticLockExceptions has not changed between 1.x and 2.x.

It sounds like the frequency of collisions has changed.

- Karen

Lars Kiesow

unread,
Sep 28, 2016, 8:43:08 AM9/28/16
to us...@opencast.org
Not necessarily. We had a lot of problems with this in 1.6 for a while.
–Lars

Karen Dolan

unread,
Sep 28, 2016, 8:52:54 AM9/28/16
to us...@opencast.org
Lars,

> Not necessarily. We had a lot of problems with this in 1.6 for a while.

The 1.6x collision resolutions that I know about (i.e RESUME race condition) were solved ensuring locks around the resources. Basically, de-optimizing them.

- Karen

> On Wed, 28 Sep 2016 08:39:40 -0400
> Karen Dolan <kdo...@dce.harvard.edu> wrote:
>
>> Lars,
>>
>>
>>> if I am informed correctly, the relevant code and the cause of these
>>> OptimisticLockExceptions has not changed between 1.x and 2.x.
>>
>> It sounds like the frequency of collisions has changed.
>>
>> - Karen
>>
>

Paul Pettit

unread,
Sep 30, 2016, 3:55:37 AM9/30/16
to us...@opencast.org
Hi All,

Thanks for everyone's input. I guess these are nothing to worry about as
nothing seems to actually go wrong and others are getting the same
exceptions. I was worried that I had got some config wrong somewhere.

I don't see any other different errors further up the logs, just these
exceptions.

I am occasionally seeing MySQLNonTransientConnectionException regarding
the mysql connection (see below) but they seem to happen at different
times to the other exceptions.

Thanks,

Paul.

2016-09-30 06:58:46,623 | WARN | (Category:855) - [c3p0] A
PooledConnection that has already signalled a Connection error is still
in use!
2016-09-30 06:58:46,623 | WARN | (Category:855) - [c3p0] Another error
has occurred [
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No
operations allowed after connection closed. ] which will not be reported
to listeners!
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No
operations allowed after connection closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)[:1.8.0_101]
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_101]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_101]
at
java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_101]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
at
com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1320)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1312)
at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4547)
at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4512)
at
com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)
at
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.wasFailureCommunicationBased(DatabasePlatform.java:2913)
at
org.eclipse.persistence.platform.server.ServerPlatformBase.wasFailureCommunicationBased(ServerPlatformBase.java:528)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1616)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:676)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560)
at
org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2055)
at
org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
at
org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:258)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:281)
at
org.eclipse.persistence.queries.DataReadQuery.executeNonCursor(DataReadQuery.java:197)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:152)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DataReadQuery.execute(DataReadQuery.java:137)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:803)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
at
org.eclipse.persistence.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:326)
at
org.eclipse.persistence.mappings.DirectCollectionMapping.valueFromRow(DirectCollectionMapping.java:3176)
at
org.eclipse.persistence.mappings.ForeignReferenceMapping.buildCloneFromRow(ForeignReferenceMapping.java:336)
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoWorkingCopyClone(ObjectBuilder.java:1997)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneFromRow(ObjectBuilder.java:2250)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:848)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:735)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:689)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:803)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:879)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:546)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1173)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1132)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:425)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1220)[84:org.eclipse.persistence.core:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1790)
at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:911)[85:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:854)[85:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:730)[85:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:599)[85:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101]
at
org.apache.aries.jpa.container.impl.EntityManagerProxyFactory$EMHandler.invoke(EntityManagerProxyFactory.java:31)[79:org.apache.aries.jpa.container:1.0.2]
at com.sun.proxy.$Proxy31.find(Unknown
Source)[85:org.eclipse.persistence.jpa:2.6.0.v20150309-bf26070]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.getJpaJob(ServiceRegistryJpaImpl.java:808)[158:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.getJob(ServiceRegistryJpaImpl.java:831)[158:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.updateJob(ServiceRegistryJpaImpl.java:858)[158:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.updateJob(ServiceRegistryJpaImpl.java:882)[158:matterhorn-serviceregistry:2.2.0.SNAPSHOT]
at
org.opencastproject.workflow.impl.WorkflowServiceImpl.updateOperationJob(WorkflowServiceImpl.java:2011)[257:matterhorn-workflow-service-impl:2.2.0.SNAPSHOT]
at
org.opencastproject.workflow.impl.WorkflowServiceImpl.runWorkflowOperation(WorkflowServiceImpl.java:891)[257:matterhorn-workflow-service-impl:2.2.0.SNAPSHOT]
at
org.opencastproject.workflow.impl.WorkflowServiceImpl.process(WorkflowServiceImpl.java:1942)[257:matterhorn-workflow-service-impl:2.2.0.SNAPSHOT]
at
org.opencastproject.workflow.impl.WorkflowServiceImpl$JobRunner.call(WorkflowServiceImpl.java:2361)[257:matterhorn-workflow-service-impl:2.2.0.SNAPSHOT]
at
org.opencastproject.workflow.impl.WorkflowServiceImpl$JobRunner.call(WorkflowServiceImpl.java:2327)[257:matterhorn-workflow-service-impl:2.2.0.SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The
last packet successfully received from the server was 45,520,375
milliseconds ago. The last packet sent successfully to the server was
45,520,375 milliseconds ago. is longer than the server configured value
of 'wait_timeout'. You should consider either expiring and/or testing
connection validity before use in your application, increasing the
server configured values for client timeouts, or using the Connector/J
connection property 'autoReconnect=true' to avoid this problem.
at sun.reflect.GeneratedConstructorAccessor401.newInstance(Unknown Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_101]
at
java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_101]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1129)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3988)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2598)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2313)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
... 58 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)[:1.8.0_101]
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)[:1.8.0_101]
at
java.net.SocketOutputStream.write(SocketOutputStream.java:153)[:1.8.0_101]
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)[:1.8.0_101]
at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)[:1.8.0_101]
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3969)
... 66 more


Stephen Marquard

unread,
Sep 30, 2016, 4:03:11 AM9/30/16
to us...@opencast.org
Hi Paul,

A stack trace in the logs is definitely a bug, as if the condition is expected, then the code should catch the exception and do something appropriate with it.

So I'd suggest you create a JIRA whenever you see this behaviour.

Regards
Stephen

---
Stephen Marquard, Learning Technologies Co-ordinator,
Centre for Innovation in Learning and Teaching (CILT)
University of Cape Town
http://www.cilt.uct.ac.za
stephen....@uct.ac.za
Phone: +27-21-650-5037 Cell: +27-83-500-5290

-----Original Message-----
From: Paul Pettit [mailto:p.pe...@keele.ac.uk]
Sent: 30 September 2016 09:56 AM
To: us...@opencast.org
Subject: Re: [OC Users] persistence exception

--
You received this message because you are subscribed to the Google Groups "Opencast Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

Disclaimer - University of Cape Town This e-mail is subject to UCT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111. If this e-mail is not related to the business of UCT, it is sent by the sender in an individual capacity. Please report security incidents or abuse via cs...@uct.ac.za

Dietmar Zenker

unread,
Sep 30, 2016, 4:03:17 AM9/30/16
to Opencast Users

Hi Paul,

I guess your problem is caused by a timeout problem which is further discussed here.

Greetings,
Dietmar

Andreas Krieger

unread,
Sep 30, 2016, 4:03:53 AM9/30/16
to us...@opencast.org
As regards the MySQLNonTransientConnectionException mentioned here:
a simple "me too"; though not sure this was the cause, I had to
restart the application to get it react to eg. capture agent requests again.
(on a very fresh 2.2.2 installation).

Would be good to know where it comes from and what to tune to get rid
of.

Regards, Andreas
> --
> You received this message because you are subscribed to the Google Groups
> "Opencast Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to users+un...@opencast.org.
>

-----------------------
BSc andreas...@tuwien.ac.at
01/58801 DW 41523
mobil: 0664/60 588 4523
TU Wien
DVR-Nummer: 0005886
-----------------------

Karen Dolan

unread,
Sep 30, 2016, 11:29:31 AM9/30/16
to us...@opencast.org
>
> A stack trace in the logs is definitely a bug, as if the condition is expected, then the code should catch the exception and do something appropriate with it.
>
> So I'd suggest you create a JIRA whenever you see this behaviour.

+1

Benjamin Halbrock

unread,
Oct 1, 2016, 4:37:13 AM10/1/16
to Opencast Users
+1

Danny Jeronimo

unread,
Oct 7, 2016, 8:33:12 AM10/7/16
to Opencast Users
I have the same errors.

Andi

unread,
Jan 10, 2017, 9:47:26 AM1/10/17
to Opencast Users
For sake of completeness and for other adopters having the same "non-problem" of lots of OptimisticLockExceptions:

As of https://groups.google.com/a/opencast.org/forum/#!topic/users/cidjyW1j08U
I can confirm that with our system (2.2.2) those exceptions cease to exist as soon as the key
"dispatchinterval" is explicitly set to zero on worker and presentation node
in org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.cfg.

Regards, Andreas
Reply all
Reply to author
Forward
0 new messages