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

Hibernate Reactive with Oracle after bump to 2.2.1 throws casting exception - cannot cast DeleteOrUpsertOperation to OptionalTableUpdate #38263

Closed
michalvavrik opened this issue Jan 17, 2024 · 10 comments · Fixed by #38367
Assignees
Labels
area/hibernate-reactive Hibernate Reactive area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Jan 17, 2024

Describe the bug

#38162 is causing issue in my Hibernate Reactive app using Oracle database. I inspected:

without success.

Expected behavior

Works.

Actual behavior

Exception is thrown and app startup fails:

20:15:35,049 INFO  [app] 20:15:33,870 Failed to start application (with profile [prod]): java.lang.RuntimeException: Failed to start quarkus
20:15:35,049 INFO  [app] 	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
20:15:35,049 INFO  [app] 	at io.quarkus.runtime.Application.start(Application.java:101)
20:15:35,049 INFO  [app] 	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
20:15:35,050 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
20:15:35,050 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
20:15:35,050 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
20:15:35,050 INFO  [app] 	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
20:15:35,050 INFO  [app] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
20:15:35,050 INFO  [app] 	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
20:15:35,051 INFO  [app] 	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
20:15:35,051 INFO  [app] 	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
20:15:35,051 INFO  [app] Caused by: jakarta.persistence.PersistenceException: Unable to build EntityManagerFactory
20:15:35,051 INFO  [app] 	at io.quarkus.hibernate.reactive.runtime.FastBootHibernateReactivePersistenceProvider.createEntityManagerFactory(FastBootHibernateReactivePersistenceProvider.java:102)
20:15:35,051 INFO  [app] 	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
20:15:35,051 INFO  [app] 	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
20:15:35,052 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:157)
20:15:35,052 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:64)
20:15:35,052 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:1583)
20:15:35,052 INFO  [app] Caused by: java.lang.ClassCastException: class org.hibernate.sql.model.jdbc.DeleteOrUpsertOperation cannot be cast to class org.hibernate.sql.model.internal.OptionalTableUpdate (org.hibernate.sql.model.jdbc.DeleteOrUpsertOperation and org.hibernate.sql.model.internal.OptionalTableUpdate are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @46f7f36a)
20:15:35,052 INFO  [app] 	at org.hibernate.reactive.persister.entity.impl.ReactiveMergeCoordinatorStandardScopeFactory.createOperation(ReactiveMergeCoordinatorStandardScopeFactory.java:107)
20:15:35,052 INFO  [app] 	at org.hibernate.reactive.persister.entity.impl.ReactiveMergeCoordinatorStandardScopeFactory.createOperationGroup(ReactiveMergeCoordinatorStandardScopeFactory.java:56)
20:15:35,052 INFO  [app] 	at org.hibernate.persister.entity.mutation.UpdateCoordinatorStandard.buildStaticUpdateGroup(UpdateCoordinatorStandard.java:1646)
20:15:35,053 INFO  [app] 	at org.hibernate.persister.entity.mutation.UpdateCoordinatorStandard.<init>(UpdateCoordinatorStandard.java:90)
20:15:35,053 INFO  [app] 	at org.hibernate.persister.entity.mutation.MergeCoordinator.<init>(MergeCoordinator.java:23)
20:15:35,053 INFO  [app] 	at org.hibernate.reactive.persister.entity.impl.ReactiveMergeCoordinatorStandardScopeFactory.<init>(ReactiveMergeCoordinatorStandardScopeFactory.java:34)
20:15:35,053 INFO  [app] 	at org.hibernate.reactive.persister.entity.impl.ReactiveCoordinatorFactory.buildMergeCoordinator(ReactiveCoordinatorFactory.java:56)
20:15:35,053 INFO  [app] 	at org.hibernate.reactive.persister.entity.impl.ReactiveSingleTableEntityPersister.buildMergeCoordinator(ReactiveSingleTableEntityPersister.java:107)
20:15:35,053 INFO  [app] 	at org.hibernate.persister.entity.AbstractEntityPersister.doLateInit(AbstractEntityPersister.java:3415)
20:15:35,054 INFO  [app] 	at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:3679)
20:15:35,054 INFO  [app] 	at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.finishInitialization(MappingMetamodelImpl.java:201)
20:15:35,054 INFO  [app] 	at org.hibernate.internal.SessionFactoryImpl.initializeMappingModel(SessionFactoryImpl.java:364)
20:15:35,054 INFO  [app] 	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:293)
20:15:35,054 INFO  [app] 	at org.hibernate.reactive.session.impl.ReactiveSessionFactoryImpl.<init>(ReactiveSessionFactoryImpl.java:28)
20:15:35,054 INFO  [app] 	at io.quarkus.hibernate.reactive.runtime.boot.FastBootReactiveEntityManagerFactoryBuilder.build(FastBootReactiveEntityManagerFactoryBuilder.java:31)
20:15:35,055 INFO  [app] 	at io.quarkus.hibernate.reactive.runtime.FastBootHibernateReactivePersistenceProvider.createEntityManagerFactory(FastBootHibernateReactivePersistenceProvider.java:92)
20:15:35,055 INFO  [app] 	... 5 more

How to Reproduce?

Reproducer:

  1. [email protected]:michalvavrik/quarkus-test-suite.git
  2. quarkus-test-suite
  3. mvn clean verify -f sql-db/hibernate-reactive/ -Dit.test=OracleDatabaseIT

Output of uname -a or ver

Fedora 38

Output of java -version

21

Quarkus version or git rev

999-SNAPSHOT

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.4

Additional information

No response

@michalvavrik michalvavrik added the kind/bug Something isn't working label Jan 17, 2024
@quarkus-bot quarkus-bot bot added area/hibernate-reactive Hibernate Reactive area/persistence OBSOLETE, DO NOT USE labels Jan 17, 2024
Copy link

quarkus-bot bot commented Jan 17, 2024

/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive)

@rsvoboda
Copy link
Member

CC @gsmet as this is probably in 3.7.0.CR1

@DavideD
Copy link
Contributor

DavideD commented Jan 18, 2024

I will have a look

@DavideD DavideD self-assigned this Jan 18, 2024
@mocenas
Copy link
Contributor

mocenas commented Jan 18, 2024

I've encountered the same issue and also tracked it to the #38162.

@DavideD
Copy link
Contributor

DavideD commented Jan 18, 2024

@michalvavrik, I've run the reproducer following your instructions and everything seems to work fine for me.

Maybe the snapshot you are using is not the latest one?

@michalvavrik
Copy link
Member Author

michalvavrik commented Jan 18, 2024

@michalvavrik, I've run the reproducer following your instructions and everything seems to work fine for me.

Maybe the snapshot you are using is not the latest one?

@DavideD if by the latest one you mean less than 15 hours less, then sure. Let me check with state as of right now. I'll get back to you.

@michalvavrik
Copy link
Member Author

@DavideD FYI you can also see it here https://github.com/quarkus-qe/quarkus-test-suite/actions/runs/7564108247, but let me check manually. not sure where is difference between your attempt and ours.

@DavideD
Copy link
Contributor

DavideD commented Jan 18, 2024

Thanks, I've just realized that it could be me not being up to date. I'm cleaning my environment and I will try again

@michalvavrik
Copy link
Member Author

np @DavideD thanks for looking at it so quickly

@DavideD
Copy link
Contributor

DavideD commented Jan 18, 2024

Ok, I can see the error now. I wasn't using the latest snapshot

mocenas added a commit to mocenas/quarkus-test-suite that referenced this issue Jan 19, 2024
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Jan 19, 2024
This code causes a failure with Quarkus at start up:
quarkusio/quarkus#38263

CI stil works when I remove, and
a `DeleteOrUpsertOperation` cannot be cast to `OptionalTableUpdate`,
so I don't think this code is useful.
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Jan 19, 2024
This code causes a failure with Quarkus at start up:
quarkusio/quarkus#38263

CI still works when I remove it, and a `DeleteOrUpsertOperation`
cannot be cast to `OptionalTableUpdate` anyway,
so I don't think this code is useful.
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Jan 19, 2024
This code causes a failure with Quarkus at start up:
quarkusio/quarkus#38263

CI still works when I remove it, and a `DeleteOrUpsertOperation`
cannot be cast to `OptionalTableUpdate` anyway.

So I don't think this code is useful.
DavideD added a commit to hibernate/hibernate-reactive that referenced this issue Jan 19, 2024
This code causes a failure with Quarkus at start up:
quarkusio/quarkus#38263

CI still works when I remove it, and a `DeleteOrUpsertOperation`
cannot be cast to `OptionalTableUpdate` anyway.

So I don't think this code is useful.
@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Jan 24, 2024
@gsmet gsmet modified the milestones: 3.9 - main, 3.7.1 Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-reactive Hibernate Reactive area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants