1 Reply Latest reply on Mar 12, 2012 2:55 PM by Cdelahun-Oracle

    Query sent to a unactivated UnitOfWork

    888359
      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?