Hi Marcus,

Thank you very much for your report.

There's a known issue / regression in version 3.9 that causes trouble when
users use data type rewriting for boolean data types:
https://github.com/jOOQ/jOOQ/issues/5943

Your issue looks different, though, #5943 would affect NUMBER parameters
that are rewritten to BOOLEAN, not actual PL/SQL BOOLEAN parameters.

Have you been able to debug through the jOOQ code to see what's null at
AbstractRoutine.java:1020 ? I don't see anything that could cause this
NPE...

Lukas

2017-04-10 17:47 GMT+02:00 Marcus Müller <[email protected]>:

> Hi,
>
>
> While evaluating jOOQ 3.9.1 I have trouble to call functions with BOOLEAN
> as parameter type.
>
>
>
> I use an Oracle 12c database:
>
>
>
> CREATE OR REPLACE FUNCTION TestFunction3(Flag IN BOOLEAN) RETURN NUMBER IS
>
> BEGIN
>
>     IF(Flag=TRUE) THEN
>
>         RETURN 1;
>
>     ELSE
>
>         RETURN 0;
>
>     END IF;
>
> END;
>
> /
>
>
>
> My test looks like:
>
>
>
> @Test
> *public void *test3() *throws *Exception {
>     Number result = Routines.*testfunction3*(*create*.configuration(),
> Boolean.*TRUE*);
>     *assertEquals*(1, result.intValue());
> }
>
>
>
> DEBUG org.jooq.tools.LoggerListener - Calling routine          : declare
> b2 boolean := case ? when 0 then false when 1 then true else null end;
> begin ? := "TESTFUNCTION3"("FLAG" => b2); end;
>
> DEBUG org.jooq.tools.LoggerListener - -> with bind values      : declare
> b2 boolean := case 1 when 0 then false when 1 then true else null end;
> begin ? := "TESTFUNCTION3"("FLAG" => b2); end;
>
> DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC
> Connection from DataSource
>
> DEBUG org.jooq.tools.LoggerListener - Exception
>
> java.lang.NullPointerException
>
>                     at org.jooq_3.9.1.ORACLE.debug(Unknown Source)
>
>                     at org.jooq.impl.AbstractRoutine.registerOutParameter(
> AbstractRoutine.java:1020)
>
>                     at org.jooq.impl.AbstractRoutine.
> registerOutParameters(AbstractRoutine.java:1010)
>
>                     at org.jooq.impl.AbstractRoutine.
> executeCallableStatement(AbstractRoutine.java:434)
>
>                     at org.jooq.impl.AbstractRoutine.
> execute(AbstractRoutine.java:347)
>
>                     at org.jooq.impl.AbstractRoutine.
> execute(AbstractRoutine.java:281)
>
>                     at com.lstelcom.spplus.db.Routines.testfunction3(
> Routines.java:10287)
>
>                     at com.lstelcom.spplus.jooq.JooqTests.test3(JooqTests.
> java:114)
>
>                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>
>                     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>
>                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>
>                     at java.lang.reflect.Method.invoke(Method.java:498)
>
>                     at org.junit.runners.model.FrameworkMethod$1.
> runReflectiveCall(FrameworkMethod.java:50)
>
>                     at org.junit.internal.runners.
> model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>
>                     at org.junit.runners.model.FrameworkMethod.
> invokeExplosively(FrameworkMethod.java:47)
>
>                     at org.junit.internal.runners.statements.InvokeMethod.
> evaluate(InvokeMethod.java:17)
>
>                     at org.springframework.test.context.junit4.statements.
> RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.
> java:75)
>
>                     at org.springframework.test.context.junit4.statements.
> RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
>
>                     at org.springframework.test.context.junit4.statements.
> SpringRepeat.evaluate(SpringRepeat.java:84)
>
>                     at org.junit.runners.ParentRunner.runLeaf(
> ParentRunner.java:325)
>
>                     at org.springframework.test.context.junit4.
> SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
>
>                     at org.springframework.test.context.junit4.
> SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
>
>                     at org.junit.runners.ParentRunner$3.run(
> ParentRunner.java:290)
>
>                     at org.junit.runners.ParentRunner$1.schedule(
> ParentRunner.java:71)
>
>                     at org.junit.runners.ParentRunner.runChildren(
> ParentRunner.java:288)
>
>                     at org.junit.runners.ParentRunner.access$000(
> ParentRunner.java:58)
>
>                     at org.junit.runners.ParentRunner$2.evaluate(
> ParentRunner.java:268)
>
>                     at org.springframework.test.context.junit4.statements.
> RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
>
>                     at org.springframework.test.context.junit4.statements.
> RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
>
>                     at org.junit.runners.ParentRunner.run(ParentRunner.
> java:363)
>
>                     at org.springframework.test.context.junit4.
> SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
>
>                     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
>
>                     at com.intellij.junit4.JUnit4IdeaTestRunner.
> startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
>
>                     at com.intellij.rt.execution.
> junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
>
>                     at com.intellij.rt.execution.junit.JUnitStarter.
> prepareStreamsAndStart(JUnitStarter.java:237)
>
>                     at com.intellij.rt.execution.junit.JUnitStarter.main(
> JUnitStarter.java:70)
>
>
>
> Is this a known issue or do I miss anything?
>
>
> Thank you,
>
> Marcus
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to