This discussion is archived
1 Reply Latest reply: Mar 12, 2012 7:55 AM by cdelahun RSS

Query sent to a unactivated UnitOfWork

888359 Newbie
Currently Being Moderated
Hi,

I've a bug on a application using TopLink 10.1.3.
The exception occurs only when the cache (soft/weak) is enabled on the targeted objects.
I've to descriptor named "Sv2Demande" and "Sv2Modification". "Sv2Demande" has a one-to-many relationship to "Sv2Modification" with transparent indirection.

With the cache is activated (usual object caching - not the result caching) , if a update the "Sv2Demande" and then read it again, TopLink gives me an instance of "Sv2Demande" with a reference to the previous unit of work in its Inderection Object. So when I trigger the indirection using:
mySv2Demande.getSv2Modification();
The following exception occurs:

Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.QueryException
Exception Description: Query sent to a unactivated UnitOfWork.
Query: ReadAllQuery(eu.curia.suivi2.model.Sv2Modification)
     at oracle.toplink.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:816)
     at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2576)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
     at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:62)
     at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:55)
     at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
     at oracle.toplink.indirection.IndirectList.buildDelegate(IndirectList.java:202)
     at oracle.toplink.indirection.IndirectList.getDelegate(IndirectList.java:359)
     at oracle.toplink.indirection.IndirectList.size(IndirectList.java:703)
     at eu.curia.suivi2.datamanager.impl.DemandesDataManagerImpl.copyPropertiesFromDbToModelLight(DemandesDataManagerImpl.java:2039)
     at eu.curia.suivi2.datamanager.impl.DemandesDataManagerImpl.loadListeDemandesRecherche(DemandesDataManagerImpl.java:2794)

I have checked and we don't keep the reference to Sv2Demande used by the UnitOfWork, we reload it using a ReadQuery in a common ServerSession.

Any ideas?
  • 1. Re: Query sent to a unactivated UnitOfWork
    cdelahun Pro
    Currently Being Moderated
    TopLink 10.1.3.0 is rather old and there have been a number of issues that might be related that have been since fixed. Try the latest version or at least the latest 10.1.3 patchset and see if it helps. If it does not, you may need to open a case with support to look into it further.

    Best Regards,
    Chris

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points