Hi Leander,

Thank you very much for bringing this to our attention. This is a bug -
there shouldn't be any NullPointerException. I have registered an issue for
this:
https://github.com/jOOQ/jOOQ/issues/5017

As a workaround, you can use your own mock TransactionProvider and supply
that to your jOOQ Configuration.

I suspect that jOOQ should ship with a default MockTransactionProvider that
simply doesn't do anything. In order to better understand the use-case of
mocking the connection in a transactional context (if that even makes
sense), what are your expectations towards the behaviour of jOOQ in that
case? At some point, you'll be implementing a whole database... :)

Best Regards,
Lukas

2016-01-31 0:48 GMT+01:00 Leander Kurscheidt <[email protected]>:

> Hello,
> to unit-test my code, i am following the recommendation from here:
> http://www.jooq.org/doc/3.4/manual/tools/jdbc-mocking/. But for one query
> i have to resort to an transaction, but it seems that MockConnections
> setSavepoint() returns null, resulting in an Nullpointer-exception.
> this is my stack trace:
>
> java.lang.NullPointerException
> at java.util.ArrayDeque.addFirst(ArrayDeque.java:228)
> at java.util.ArrayDeque.push(ArrayDeque.java:503)
> at
> org.jooq.impl.DefaultTransactionProvider.begin(DefaultTransactionProvider.java:155)
> at
> org.jooq.impl.DefaultDSLContext.transactionResult(DefaultDSLContext.java:338)
>
> am i doing something wrong? Or is that beyond the reach of the
> MockConnection?
>
> --
> 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