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

Integration with H2 #1336

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Integration with H2 #1336

wants to merge 9 commits into from

Conversation

DavideD
Copy link
Member

@DavideD DavideD commented Jun 13, 2022

Fix #929
It's a draft because I need to review it

@DavideD DavideD force-pushed the wip/h2 branch 2 times, most recently from ae5a255 to 7b4f29a Compare June 14, 2022 12:40
@DavideD
Copy link
Member Author

DavideD commented Jun 14, 2022

We had this error on CI (I need to have a look at it later):


Gradle Test Executor 1 > org.hibernate.reactive.CacheTest > testCacheWithNativeSQL FAILED
    java.util.concurrent.CompletionException: javax.persistence.PersistenceException: org.hibernate.HibernateException: java.util.concurrent.CompletionException: java.lang.NullPointerException
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:932)
        at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:143)
        at org.hibernate.reactive.session.impl.ReactiveSessionImpl.firePersist(ReactiveSessionImpl.java:678)
        at org.hibernate.reactive.session.impl.ReactiveSessionImpl.reactivePersist(ReactiveSessionImpl.java:662)
        at org.hibernate.reactive.util.impl.CompletionStages.lambda$loop$2(CompletionStages.java:177)
        at org.hibernate.reactive.util.impl.CompletionStages$ArrayLoop.next(CompletionStages.java:396)
        at org.hibernate.reactive.util.async.impl.AsyncTrampoline.lambda$asyncWhile$1(AsyncTrampoline.java:215)
        at org.hibernate.reactive.util.async.impl.AsyncTrampoline$TrampolineInternal.unroll(AsyncTrampoline.java:121)
        at org.hibernate.reactive.util.async.impl.AsyncTrampoline$TrampolineInternal.trampoline(AsyncTrampoline.java:102)
        at org.hibernate.reactive.util.async.impl.AsyncTrampoline.asyncWhile(AsyncTrampoline.java:197)
        at org.hibernate.reactive.util.async.impl.AsyncTrampoline.asyncWhile(AsyncTrampoline.java:215)
        at org.hibernate.reactive.util.impl.CompletionStages.loop(CompletionStages.java:356)
        at org.hibernate.reactive.util.impl.CompletionStages.loop(CompletionStages.java:340)
        at org.hibernate.reactive.util.impl.CompletionStages.loop(CompletionStages.java:177)
        at org.hibernate.reactive.util.impl.CompletionStages.applyToAll(CompletionStages.java:419)
        at org.hibernate.reactive.stage.impl.StageSessionImpl.persist(StageSessionImpl.java:137)
        at org.hibernate.reactive.CacheTest.lambda$testCacheWithNativeSQL$32(CacheTest.java:135)
        Caused by:
        javax.persistence.PersistenceException: org.hibernate.HibernateException: java.util.concurrent.CompletionException: java.lang.NullPointerException
            at app//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
            at app//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
            at app//org.hibernate.reactive.session.impl.ReactiveExceptionConverter.convert(ReactiveExceptionConverter.java:31)
            at app//org.hibernate.reactive.session.impl.ReactiveSessionImpl.lambda$firePersist$18(ReactiveSessionImpl.java:685)
            at [email protected]/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
            ... 18 more
            Caused by:
            org.hibernate.HibernateException: java.util.concurrent.CompletionException: java.lang.NullPointerException
                at app//org.hibernate.reactive.session.impl.ReactiveExceptionConverter.convert(ReactiveExceptionConverter.java:31)
                ... 20 more
                Caused by:
                java.util.concurrent.CompletionException: java.lang.NullPointerException
                    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
                    at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:683)
                    at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
                    at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
                    at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:143)
                    at org.hibernate.reactive.id.impl.SequenceReactiveIdentifierGenerator.nextHiValue(SequenceReactiveIdentifierGenerator.java:45)
                    at org.hibernate.reactive.id.impl.BlockingIdentifierGenerator.generate(BlockingIdentifierGenerator.java:59)
                    at org.hibernate.reactive.id.impl.ReactiveGeneratorWrapper.generate(ReactiveGeneratorWrapper.java:38)
                    at org.hibernate.reactive.id.impl.IdentifierGeneration.generateId(IdentifierGeneration.java:140)
                    at org.hibernate.reactive.event.impl.AbstractReactiveSaveEventListener.reactiveSaveWithGeneratedId(AbstractReactiveSaveEventListener.java:122)
                    at org.hibernate.reactive.event.impl.DefaultReactivePersistEventListener.entityIsTransient(DefaultReactivePersistEventListener.java:179)
                    at org.hibernate.reactive.event.impl.DefaultReactivePersistEventListener.reactiveOnPersist(DefaultReactivePersistEventListener.java:128)
                    at org.hibernate.reactive.event.impl.DefaultReactivePersistEventListener.reactiveOnPersist(DefaultReactivePersistEventListener.java:58)
                    at org.hibernate.event.service.internal.EventListenerGroupImpl.lambda$fireEventOnEachListener$0(EventListenerGroupImpl.java:133)
                    at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
                    at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
                    at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:143)
                    at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:133)
                    at org.hibernate.reactive.session.impl.ReactiveSessionImpl.firePersist(ReactiveSessionImpl.java:676)
                    ... 14 more
                    Caused by:
                    java.lang.NullPointerException
                        at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)


@Override
public String getUri() {
return "h2:~/test;DATABASE_TO_UPPER=FALSE;DB_CLOSE_DELAY=-1";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will use an H2 instance baked by a file in the home directory. Could we use an in-memory instance instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for H2
3 participants