Issue Details (XML | Word | Printable)

Key: NUCRDBMS-691
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Germán Dressino
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

StackOverflowError when querying with inactive transaction

Created: 02/Sep/13 05:07 PM   Updated: 21/Dec/13 11:37 AM   Resolved: 11/Dec/13 12:11 PM
Component/s: Queries
Affects Version/s: 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.0.10, 3.1.0.m1, 3.1.0.m2, 3.1.0.m3, 3.1.0.m4, 3.1.0.m5, 3.1.0.release, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.2.0.m1, 3.2.0.m2, 3.2.0.m3, 3.2.0.m4, 3.2.0.release, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6
Fix Version/s: None

File Attachments: 1. Zip Archive DNTest.zip (6 kB)

Environment: Tested with JDK1.6 and JDK1.7 on linux

Forum Thread URL: http://www.datanucleus.org/servlet/forum/viewthread_thread,7582
Datastore: HSQL, PostgreSQL
Severity: Production


 Description  « Hide
Given this class model:

Pet
 .
/_\
 |
 | (Dog extends Pet)
 |
 |
Dog <--dog---------- Toy (Toy knows Dog)


This query executes OK in an active transaction and throws StackOverflowError in an inactive transaction:

      Query q = pm.newQuery(Toy.class);
      q.setResult("dog as dog");
      q.execute();

Note 1: this will not occur when objects are retrieved from the datastore cache. It will happen with cleared cache and fresh persistence managers.

Note 2: this test case runs OK until DN 3.0.4 and fails with 3.0.5+ (including 3.2.6)


Germán Dressino made changes - 02/Sep/13 05:09 PM
Field Original Value New Value
Attachment DNTest.zip [ 12002 ]
Andy Jefferson added a comment - 04/Dec/13 08:27 AM
SVN trunk (and likely some of the last few releases) don't show this. The fact is simple, if you run non-transactional *and don't mark the connection to be retained* then the connection has to be handed back to the pool, so it will have to read in *all* results before returning to the user. This, by its very nature, will increase the "stack" of calls, and likely the presented test would "fail" if there were more results. Obviously there are very simple ways of this working, run transactional, or set the persistence property "datanucleus.connection.nontx.releaseAfterUse" to false.

Andy Jefferson added a comment - 11/Dec/13 12:11 PM
Marking as Wont Fix since dont see it with current code and there are ample ways of such things working

Andy Jefferson made changes - 11/Dec/13 12:11 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Andy Jefferson made changes - 21/Dec/13 11:37 AM
Status Resolved [ 5 ] Closed [ 6 ]