Re: Problems with extra N+1 requests - likely due to poor mapping defns, but not sure how to rectify


ebenzacar@...
 
Edited

Hi @Andy,

I have finally been able to reproduce my error in a test case for you,using the sample app that you provided.  I have created a branch in github repo illustrate the problem. https://github.com/benze/test-jdo/tree/implicit-transaction-errors
Similarly, I have opened an issue in the rdbms module as I suspect it is something specific with the rdbms module (although I may be mistaken): https://github.com/datanucleus/datanucleus-rdbms/issues/369.

I am using an Abstract class with 2 subclass tables as my N-1 relation.  I do see a warning from DN that this is not fully supported so I don't know if that is the root cause, however, oddly enough, it works fine with transaction boundaries explicitly defined.

If, however, I use implicit transactions (and remove the `tx.begin()` and `tx.commit()`), the test fails with an endless loop and generates a StackOverflow issue.  I have traced down the issue into something in the `org.datanucleus.store.rdbms.ConnectionFactoryImpl.ManagedConnectionImpl#release()` as it tries to commitOnRelease, but get a little bit lost in the logic as to why the release is trying to iterate to the end of an open result set instead of just closing the result set as such.

I would be happy to help provide a fix for this, however, I am not able to fully grasp the complete theory behind the existing logic.

Thanks,

Eric

Join main@datanucleus.groups.io to automatically receive all group messages.