Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManyToMany fakes delete statements?! #3229

Closed
tbee opened this issue Oct 5, 2023 · 10 comments
Closed

ManyToMany fakes delete statements?! #3229

tbee opened this issue Oct 5, 2023 · 10 comments
Labels

Comments

@tbee
Copy link
Contributor

tbee commented Oct 5, 2023

Expected behavior

We have the following setup:

class AuthorizationAssignment {
    @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinTable(name = "authorizationassignment_authorizationprofile",
            joinColumns = {@JoinColumn(name = "authorizationassignment")},
            inverseJoinColumns = {@JoinColumn(name = "authorizationprofile")})
    private Set<AuthorizationProfile> profiles;
}

class AuthorizationProfile {
    @ManyToMany(mappedBy = "profiles")
    private Set<AuthorizationAssignment> authorizationAssignments;
}

Actual behavior

Under EBean 12.16.1, when the AuthorizationAssignment is saved, we see the following lines in EBean's logging:

15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214] delete from authorizationassignment_authorizationprofile where authorizationassignment = ? and authorizationprofile = ?
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 32)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 24)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 18)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 8)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 6)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 2)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 7)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 1)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 12)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 17)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 23)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 36)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 5)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 9)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 35)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 19)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 27)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 16)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 11)
15:29:24,221 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 4)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 10)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 14)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 15)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 25)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 26)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 13)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 3)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 20)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 34)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 30)
15:29:24,225 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214] insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (?, ?)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 36)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 15)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 17)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 30)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 1)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 4)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 18)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 35)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 13)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 34)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 14)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 24)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 10)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 8)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 19)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 26)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 2)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 11)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 12)
15:29:24,226 DEBUG (default task-6) [io.ebean.SQL] txn[1696512564214]  -- bind(1, 9)

At which point MySQL throws an exception:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1-26' for key 'PRIMARY'
        at sun.reflect.GeneratedConstructorAccessor363.newInstance(Unknown Source) [:1.8.0_352]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_352]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [rt.jar:1.8.0_352]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1281)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:787)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2136)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2070)
        at com.mysql.jdbc.ServerPreparedStatement.executeBatchSerially(ServerPreparedStatement.java:729)
        ... 198 more

In MySQL's log we see the following lines:

2023-10-05T13:29:24.222308Z      4564 Query     select @@session.transaction_read_only
2023-10-05T13:29:24.222493Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 32
2023-10-05T13:29:24.222668Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 24
2023-10-05T13:29:24.222940Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 18
2023-10-05T13:29:24.223024Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 8
2023-10-05T13:29:24.223132Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 6
2023-10-05T13:29:24.223302Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 2
2023-10-05T13:29:24.223456Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 7
2023-10-05T13:29:24.223620Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 1
2023-10-05T13:29:24.223759Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 12
2023-10-05T13:29:24.223908Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 17
2023-10-05T13:29:24.224054Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 23
2023-10-05T13:29:24.224200Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 36
2023-10-05T13:29:24.224375Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 5
2023-10-05T13:29:24.224530Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 9
2023-10-05T13:29:24.224678Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 35
2023-10-05T13:29:24.224829Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 19
2023-10-05T13:29:24.224979Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 27
2023-10-05T13:29:24.225128Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 16
2023-10-05T13:29:24.225280Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 11
2023-10-05T13:29:24.225419Z      4564 Execute   delete from authorizationassignment_authorizationprofile where authorizationassignment = 1 and authorizationprofile = 4
2023-10-05T13:29:24.225947Z      4564 Prepare   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (?, ?)
2023-10-05T13:29:24.226067Z      4564 Close stmt        
2023-10-05T13:29:24.226569Z      4564 Query     select @@session.transaction_read_only1296292 2023-10-05T13:29:24.226775Z      4564 Query     select @@session.transaction_read_only1296293 2023-10-05T13:29:24.226963Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 36)
2023-10-05T13:29:24.227131Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 15)
2023-10-05T13:29:24.227878Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 17)
2023-10-05T13:29:24.227992Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 30)
2023-10-05T13:29:24.228255Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 1)
2023-10-05T13:29:24.228554Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 4)
2023-10-05T13:29:24.228649Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 18)
2023-10-05T13:29:24.228801Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 35)
2023-10-05T13:29:24.228957Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 13)
2023-10-05T13:29:24.229176Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 34)
2023-10-05T13:29:24.229368Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 14)
2023-10-05T13:29:24.229553Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 24)
2023-10-05T13:29:24.229692Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 10)
2023-10-05T13:29:24.229888Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 8)
2023-10-05T13:29:24.230025Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 19)
2023-10-05T13:29:24.230161Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 26)
2023-10-05T13:29:24.230313Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 2)
2023-10-05T13:29:24.230380Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 11)
2023-10-05T13:29:24.230511Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 12)
2023-10-05T13:29:24.230588Z      4564 Execute   insert into authorizationassignment_authorizationprofile (authorizationassignment, authorizationprofile) values (1, 9)
2023-10-05T13:29:24.244829Z      4564 Query     rollback

EBean's log claims to have executed delete statements after the bind(1, 4) line, but these are not visible in MySQL's log. And as a result the exception is correct. This reeks like a batching issue.

In PersistRequestBean, irrespective of if batching is enabled, the completeUpdate always batches the many to many relations. Like the line in DefaultPersister.update, there should be a saveExecuteOrQueueMany()

class DefaultPersister {
  private void update(PersistRequestBean<?> request) {
    ...
    request.executeOrQueue();
    ...
    request.completeUpdate();
  }
}

class PersistRequestBean {
  public void completeUpdate() {
    saveQueuedMany();
  }
}

Building a custom EBean version where saveBatch has hardcoded false for queue makes the problem go away.

@rbygrave
Copy link
Member

rbygrave commented Oct 9, 2023

Do you have a failing test case then? Reading this it almost seems like you have.

-- bind(1, 4)

This is at position 20 which is the default batch size (as per DatabaseConfig).

Now what ebean is logging with the -- bind(...) is that the PreparedStatement .addBatch() was executed and then every (say 20 batch Size) then the PreparedStatement.executeBatch() is called [but there is nothing explicit in the logs for this currently]. The executeBatch() is also invoked via flush() and implicitly via commit().

The above looks suspiciously like the PreparedStatement.executeBatch() is not being called when the transaction is going to commit. (and so that last 10 rows had the addBatch() call but there was no executeBatch() called).

txn[1696512564214]

This suggests the app is using an external transaction manager and probably the Spring transaction manager? Is that correct?

@rbygrave
Copy link
Member

rbygrave commented Oct 9, 2023

Caused by:

It would be useful to have the full stack trace and importantly the part of the stack trace that shows what ebean code was being executed. We are interested in what ebean code (stack trace) was flushing the inserts before all the queued deletes had the executeBatch() called on.

Only including the mysql driver code is less useful.

@tbee
Copy link
Contributor Author

tbee commented Oct 9, 2023

I'll get you the stacktrace.

We're using a modified JTATransactionManager, based on the one in EBean sources, in order to disable all batching (because of another issue: #3208). Batching seems to be seriously broken in the 12 branch and it is not possible to disable it with configuration. So we're not using the Spring transaction manager.

We do not have a test case, but a failing test scenario. I know you do not like to backport to 12, so for now we patch everything, and after the Java upgrade revisit the issues (we're at 5 issues now) based on the 13 branch.

@tbee
Copy link
Contributor Author

tbee commented Oct 9, 2023

13:10:24,443 ERROR (default task-6) [org.jboss.as.ejb3.invocation] WFLYEJB0034: Jakarta Enterprise Beans Invocation failed on component UserRepository for method public abstract com.nedap.healthcare.administration.authorization.user.User com.nedap.healthcare.administration.authorization.user.IUserRepository.update(com.nedap.healthcare.administration.authorization.user.User): javax.ejb.EJBTransactionRolledbackException: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:117) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:284) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:390) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:160) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.security.IdentityOutflowInterceptor.processInvocation(IdentityOutflowInterceptor.java:73) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.security.SecurityDomainInterceptor.processInvocation(SecurityDomainInterceptor.java:44) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:438)
        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:633) [wildfly-elytron-security-manager-1.19.1.Final.jar:1.19.1.Final]
        at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:57)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)
        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:191)
        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:81)
        at com.nedap.healthcare.administration.authorization.user.IUserRepository$$$view75.update(Unknown Source) [:]
        at com.nedap.aeos.io.web.employee.user.EmployeeLoginForm.saveUserRoles(EmployeeLoginForm.java:342)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_352]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_352]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_352]
        at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_352]
        at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:153) [jakarta.el-3.0.3.jbossorg-4.jar:3.0.3.jbossorg-4]
        at com.sun.el.parser.AstValue.invoke(AstValue.java:261) [jakarta.el-3.0.3.jbossorg-4.jar:3.0.3.jbossorg-4]
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:237) [jakarta.el-3.0.3.jbossorg-4.jar:3.0.3.jbossorg-4]
        at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-web-3.1.9.Final.jar:3.1.9.Final]
        at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-web-3.1.9.Final.jar:3.1.9.Final]
        at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-web-3.1.9.Final.jar:3.1.9.Final]
        at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-web-3.1.9.Final.jar:3.1.9.Final]
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:65)
        at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:66)
        at com.sun.faces.application.ActionListenerImpl.getNavigationOutcome(ActionListenerImpl.java:82)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:71)
        at javax.faces.component.UICommand.broadcast(UICommand.java:222) [jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:3.1.0.SP01]
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:847) [jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:3.1.0.SP01]
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1396) [jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:3.1.0.SP01]
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:58)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
        at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:707) [jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:3.1.0.SP01]
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:451) [jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:3.1.0.SP01]
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
        at org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
        at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:257)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:182)
        at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:225)
        at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:147)
        at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:110)
        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.NotFoundRedirectFilter.doFilter(NotFoundRedirectFilter.java:61)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.healthcare.router.RouterFilter.doFilter(RouterFilter.java:114) [:]
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:84)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.PagePermissionFilter.checkAuthorization(PagePermissionFilter.java:138)
        at com.nedap.aeos.io.web.PagePermissionFilter.doFilter(PagePermissionFilter.java:120)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.healthcare.auditing.jsf.AuditFilter.doFilter(AuditFilter.java:50)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.CSPFilter.doFilter(CSPFilter.java:35)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.RequestLogFilter.doFilter(RequestLogFilter.java:64)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.util.web.NoCacheFilter.doFilter(NoCacheFilter.java:29) [:]
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.healthcare.administration.web.hub.HubTicketFilter.doFilter(HubTicketFilter.java:49)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.healthcare.administration.web.hub.HubFilter.doFilter(HubFilter.java:90)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.healthcare.administration.ebean.transaction.EntityManagerFilter.doFilter(EntityManagerFilter.java:66) [:]
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:39)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.nedap.aeos.io.web.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:42)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
        at org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73) [wildfly-elytron-auth-server-1.19.1.Final.jar:1.19.1.Final]
        at org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
        at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
        at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.jrHandle(ServletInitialHandler.java:40001)
        at org.zeroturnaround.javarebel.integration.servlet.undertow.cbp.ServletInitialHandlerCBP.handleRequest(ServletInitialHandlerCBP.java:131)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79)
        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
        at java.lang.Thread.run(Thread.java:750) [rt.jar:1.8.0_352]
Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
        at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1307) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:128) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:94)
        at org.wildfly.transaction.client.LocalTransaction.commitAndDissociate(LocalTransaction.java:78) [wildfly-transaction-client-2.0.1.Final.jar:2.0.1.Final]
        at org.wildfly.transaction.client.ContextTransactionManager.commit(ContextTransactionManager.java:71) [wildfly-transaction-client-2.0.1.Final.jar:2.0.1.Final]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [wildfly-ejb3-26.1.2.Final.jar:26.1.2.Final]
        ... 167 more
Caused by: io.ebean.DuplicateKeyException: Duplicate entry '1-35' for key 'PRIMARY'
        at io.ebean.config.dbplatform.SqlCodeTranslator.translate(SqlCodeTranslator.java:72) [ebean-api-12.16.1.jar:]
        at io.ebean.config.dbplatform.DatabasePlatform.translate(DatabasePlatform.java:245) [ebean-api-12.16.1.jar:]
        at io.ebeaninternal.server.transaction.TransactionManager.translate(TransactionManager.java:206) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.transaction.JdbcTransaction.translate(JdbcTransaction.java:671) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.core.PersistRequest.translateSqlException(PersistRequest.java:118) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.ExeUpdateSql.execute(ExeUpdateSql.java:51) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.DefaultPersistExecute.executeSqlUpdate(DefaultPersistExecute.java:91) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.core.PersistRequestUpdateSql.executeAddBatch(PersistRequestUpdateSql.java:62) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.BatchControl$Queue.flush(BatchControl.java:394) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.BatchControl.flushQueue(BatchControl.java:275) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.BatchControl.flushBuffer(BatchControl.java:271) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.BatchControl.flushOnCommit(BatchControl.java:236) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.transaction.JdbcTransaction.batchFlush(JdbcTransaction.java:651) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.transaction.JdbcTransaction.internalBatchFlush(JdbcTransaction.java:774) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.transaction.JdbcTransaction.preCommit(JdbcTransaction.java:998) [ebean-core-12.16.1.jar:]
        at com.nedap.healthcare.administration.ebean.JTATransactionManager$JtaTxnListener.beforeCompletion(JTATransactionManager.java:199) [:]
        at org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.beforeCompletion(JCAOrderedLastSynchronizationList.java:113)
        at org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:236) [wildfly-transaction-client-2.0.1.Final.jar:2.0.1.Final]
        at org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:247) [wildfly-transaction-client-2.0.1.Final.jar:2.0.1.Final]
        at org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.beforeCompletion(AbstractTransaction.java:292) [wildfly-transaction-client-2.0.1.Final.jar:2.0.1.Final]
        at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:360) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1295) [narayana-jts-idlj-5.12.5.Final.jar:5.12.5.Final (revision: 434e4)]
        ... 172 more
Caused by: java.sql.BatchUpdateException: Duplicate entry '1-35' for key 'PRIMARY'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_352]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_352]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_352]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [rt.jar:1.8.0_352]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1154)
        at com.mysql.jdbc.ServerPreparedStatement.executeBatchSerially(ServerPreparedStatement.java:762)
        at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1319)
        at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:954)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:714)
        at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1180)
        at io.ebeaninternal.server.persist.BatchedPstmt.flushStatementBatch(BatchedPstmt.java:84) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.BatchedPstmt.statement(BatchedPstmt.java:73) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.PstmtFactory.pstmtBatch(PstmtFactory.java:50) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.ExeUpdateSql.bindStmt(ExeUpdateSql.java:89) [ebean-core-12.16.1.jar:]
        at io.ebeaninternal.server.persist.ExeUpdateSql.execute(ExeUpdateSql.java:36) [ebean-core-12.16.1.jar:]
        ... 191 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1-35' for key 'PRIMARY'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_352]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_352]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_352]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [rt.jar:1.8.0_352]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1281)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:787)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2136)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2070)
        at com.mysql.jdbc.ServerPreparedStatement.executeBatchSerially(ServerPreparedStatement.java:729)
        ... 200 more

@tbee
Copy link
Contributor Author

tbee commented Oct 9, 2023

Now what ebean is logging with the -- bind(...) is that the PreparedStatement .addBatch() was executed and then every (say 20 batch Size) then the PreparedStatement.executeBatch() is called [but there is nothing explicit in the logs for this currently]. The executeBatch() is also invoked via flush() and implicitly via commit().

Apparently the PreparedStatement.executeBatch() is not called after the ManyToMany has deleted its contents and then starts re-inserting them. (The fact that this is unnecessary, because the contents did not change, would be an big improvement.)

@rbygrave
Copy link
Member

rbygrave commented Oct 9, 2023

FYI: Note the change to BatchedPstmt to log the executeBatch() into the ebean SQL log - https://github.com/ebean-orm/ebean/pull/3238/files (you might want to make the same change).

I know you do not like to backport to 12

There is a branch for 12 called maintain-v12. People can submit PR's to that branch and I'll review them. Some people have requested a patch and I've done that. The focus of my time and effort is on latest.

Apparently the PreparedStatement.executeBatch() is not called after the ManyToMany has deleted its contents and then starts re-inserting them.

Well I think that is what we are looking for. If we can see where that is in the code and why then we might be able to reverse engineer a failing test.

@tbee
Copy link
Contributor Author

tbee commented Oct 9, 2023

There is a branch for 12 called maintain-v12. People can submit PR's to that branch and I'll review them. Some people have requested a patch and I've done that. The focus of my time and effort is on latest.

We do not plan to stick around on 12 for long. It's just an intermediate stop so we can upgrade from Java 8 to 17. EBean 13 comes right after that.

@tbee
Copy link
Contributor Author

tbee commented Apr 8, 2024

We're at EBean 14 now. But batching is not working (see #3363) so we cannot revisit this one.

@rbygrave
Copy link
Member

rbygrave commented Apr 8, 2024

So you are not trying to create a failing test case for this one? Or it's more that you are waiting for more progress on #3363 before you start creating a failing test case?

@tbee
Copy link
Contributor Author

tbee commented Apr 30, 2024

Because it turns out that our code base cannot run with batching enabled, we cannot revisit this issue. I'll close it.

@tbee tbee closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants