Question

i am currently stuck in a problem with the asyncSession. I tried to not just make a list, i wanted to call asyncSession.queryList(). I don't have the log-file rightnow, but it basically said that the query wasn't build in the currentThreat. (I am building it one line above) So i tried to add .forCurrentThread(), but i got the same error.

Is this feature basically working? Otherwise i will bring some more information tomorrow.

Was it helpful?

Solution

I ran into the same problem and came to the conclusion this was a bug. I ended up changing the method executeOperation() in AsyncOperationExecutor.java:

case QueryList:
            operation.result = ((Query) operation.parameter).forCurrentThread().list();
            break;
case QueryUnique:
            operation.result = ((Query) operation.parameter).forCurrentThread().unique();
            break;

Adding in the call to forCurrentThread() changes the owning thread of the Query to the thread of the ExecutorService. This made it work for me, I wonder if there is a better solution though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top