Query sent to a unactivated UnitOfWork

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?

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

Similar Messages

  • [JPA] Query sent to a unactivated UnitOfWork.

    Hi,
    Does one of the TopLink Essentials mavens have a clue why we would get the following stack trace:
    Exception [TOPLINK-6027] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadObjectQuery(xxx.xxxx.rose.model.entities.Tr01TaxpayerTin)
         at oracle.toplink.essentials.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:908)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2231)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:101)
         at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:91)
         at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
         at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:175)
         at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:247)
         at oracle.toplink.essentials.internal.indirection.UnitOfWorkQueryValueHolder.setValue(UnitOfWorkQueryValueHolder.java:84)
         at xxx.xxxx.rose.model.entities.Ta01Declaration._toplink_settaxpayer(Ta01Declaration.java)
         at xxx.xxxx.rose.model.entities.Ta01Declaration.setTaxpayer(Ta01Declaration.java:1195)
         .It doesn't seem to have anything to do with us.
    TopLink itself has modified the bytecodes for method setTaxpayer (which is a @ManyToOne(fetch=FetchType.LAZY) relationship) and has problems with it now.
    Here's info about the relationship definition and the method:
        @ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="CR01_TIN_ID", referencedColumnName="CR01_TIN_ID", nullable=false)
        private Tr01TaxpayerTin taxpayer;
        public void setTaxpayer(Tr01TaxpayerTin taxpayer) {
            this.taxpayer = taxpayer;
        }Best regards,
    Bisser

    All right, then. The following combination does the trick:
    1. persist()
    2. flush()
    3. refresh()
    4. rollback()
    5. assign a value to the @ManyToOne relationship
    BANG!  ("Query sent to a unactivated UnitOfWork.")With a commit() everything works ok. The rollback(), however, causes the exception.
    Sample code, assuming that there's a @ManyToOne relationship between Customer and Company:
    Customer.java:
         @ManyToOne(fetch=FetchType.LAZY)
         @JoinColumn(name="COMPANY_ID", referencedColumnName="ID")
         private Company company;
         public Company getCompany() {
              return company;
         public void setCompany(Company company) {
              this.company = company;
         }The code to reproduce the error:
         Customer cust = new Customer();
         cust.setName("Jones");
         cust.setCompany(comp);
         em = emf.createEntityManager();
         em.getTransaction().begin();
         em.persist(cust);
         em.flush();
         em.refresh(cust);
         em.getTransaction().rollback();
         cust.setCompany(comp);    // B A N G ! ! ! ! ! ! ! !This also crashes with the latest version of TopLink Essentials -- Oracle TopLink Essentials - 2.1 (Build b60-fcs (11/17/2008)) -- that I downloaded from here: https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html
    Which version do you use in EclipseLink? Or... is it even a version developed separately from the Glassfish version?

  • Transparent indirection = Query sent to a unactivated UnitOfWork

    Hi,
    since we upgrade from version 7 to 10g, we have an intermittent error that occur only when accessing a collection that use transparent indirection. I'm loading a participant and I want all his addresses. The addresses collection use indirection so it's only load when it's needed. But when I try to access the addresses, I get this exception :
    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(xxx.xxx.business.participant.Address)
         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$1.<init>(IndirectList.java:461)
         at oracle.toplink.indirection.IndirectList.iterator(IndirectList.java:460)
    The participant and all the other collection (not setup as transparent indirection) are loaded successfully. If I shut down the server, restart it and access the same participant, it work.
    I use the Session object to get the participant. When I successfully get the particpant, I close this session because I can't keep all session open for all the transparent indirection collection.
    We never had this problem before. Maybe something change in the management of the Toplink cache, session and indirection.
    Thank you.
    Andre

    I checked version 9 and this error seems to have always been thrown. There was no version 7 (we went from 4.5 to 9.0.3), so I'm not sure what your original version was? Are you current using 10.1.2 or 10.1.3?
    What seems to be occurring is you are unexpectedly getting a reference to an object from a UnitOfWork, instead of from the Session cache. This could be caused by your application incorrectly modifying original objects or not registering object correctly in a UnitOfWork, or from a merge issue.
    Nothing should have changed in TopLink's cache management or indirection. You may wish to try narrowing down how your application is getting a reference to a UnitOfWork clone. You can use,
    session.getIdentityMapAccessor().getFromIdentityMap(object)
    to get the cached version of an object, if your object is not identical to this, then it could be from a UnitOfWork.

  • Where to find the resolved query sent to the database?

    Verison 4.1.1.00.23
    Hello,
    Where/How do I find the actual query that is sent to the database?  I've enabled Debug on the Dev Toolbar, but I still don't see where the query that is sent to the database is at? I'm hoping to see a view with the page items resolved not what is actually in the page.
    I have a query on a collection and I keep getting a 'SQL command not properly ended' error and I'm not seeing why it's not "properly ended".
    Hope this is clear.
    Let me know if not.
    Thanks,
    Joe

    Tony,
    Thank you for replying.
    There is an update -  The query no longer throws the 'SQL command not properly ended', but now it throws the dreaded 'Missing Right Parenthesis' error.
    The query is:
                APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B (p_collection_name => 'TEAM_EMP',
                                                                p_query => 'SELECT cme_system, tbs_team_id, resource_id,
                    CASE WHEN resource_type = ''C'' THEN ''Consultant'' ELSE ''Employee'' END AS resource_type, role,
                    jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, forecast_id, project_id,
                    jan_id, feb_id, mar_id, apr_id, may_id, jun_id, jul_id, aug_id, sep_id, oct_id, nov_id, dec_id,
                    resource_name, tbs_forecast_year.last_updated, last_updated_by.last_updated_by, area_id, p.group_id, team_name,start_date, end_date, p.project_name
                    FROM tbs_forecast_year
                    INNER JOIN (SELECT project_id pid, area_id, tbs_projects.group_id, UPPER(project_name) project_name
                                FROM tbs_projects
                                WHERE status IN (''Pipeline'', ''Planned - Partially Funded'', ''Planned'', ''Execution'')) p
                    ON p.pid = project_id
                    LEFT JOIN (SELECT resource_onepass_id, resource_name last_updated_by
                               FROM resources where resource_onepass_id is not null) last_updated_by
                    ON last_updated_by.resource_onepass_id = tbs_forecast_year.last_updated_by
                    LEFT JOIN tbs_teams ON tbs_teams.team_id = tbs_team_id
                    LEFT JOIN (SELECT resources.resource_id rid, resource_name from resources) resources
                    ON rid = resource_id
                    WHERE (jan > 0 OR feb > 0 OR mar > 0 OR apr > 0 OR may > 0 OR jun > 0 OR jul > 0 OR aug > 0 OR sep > 0 OR oct > 0 OR nov > 0 OR dec > 0)
                    AND forecast_type = ''Supply''
                    AND (project_id = '|| :F189_PROJECT_ID ||' OR 0 = '||:F189_PROJECT_ID ||')
                    AND (tbs_team_id IN (SELECT * FROM the(SELECT cast(vc2_list('|| :F189_TEAM_ID ||') as vc2_list_type) FROM dual))
                        OR 0 IN (SELECT * FROM the(SELECT cast(vc2_list('|| :F189_TEAM_ID ||') as vc2_list_type) FROM dual)))
                    AND (resource_id = '|| :F189_RESOURCE_ID ||' OR 0 = '||:F189_RESOURCE_ID ||')
                    AND (team_name like ''%'|| :F189_TEAM_NAME ||'%'' OR '' '' = '' '||:F189_TEAM_NAME ||''')
                    AND (area_id = '|| :F189_AREA_ID ||' OR 0 = '||:F189_AREA_ID ||')
                    AND NOT (0 = '||:F189_RESOURCE_ID ||' AND 0 = '||:F189_AREA_ID ||' AND 0 IN (SELECT * FROM the(SELECT cast(vc2_list('||:F189_TEAM_ID||') as vc2_list_type) from dual))
                    AND 0 = '||:F189_PROJECT_ID ||' AND '' '' like '' %'||:F189_TEAM_NAME ||'%'')
    Line 22 is calling a function to deal with a Multi-Select list that I found https://community.oracle.com/message/3566187#3566187. I've created the TYPE and the function as indicated in that thread. The error is thrown when multiple Team's are selected.
    The exact error is: create_collection_from_query_b Error:ORA-20104: create_collection_from_query ParseErr:ORA-00907: missing right parenthesis
    There are going to be 4 multi-select lists and TEAM_ID is the first.
    :F189_TEAM_ID is an application item that is being populated from a page process.
    If you have a better solution for dealing with Multi-Select lists I would be very interested in hearing it.
    I've tried the replace and the instr methods with no success. Once the Collection is working then I have to modify the query for the page which is using the APEX_ITEM API's, but I haven't gotten this working yet.
    Thanks Tony!
    Joe

  • UnitOfWork doesn't release pessimistic row lock???

    I have an application that polls a DB table for new "submissions", then forwards them to another server to handle them asynchronously. When the asynchronous response comes back, my application verifies that all response have been received from the server, then sends a combined response. My problem is that the asynchronous response listener threads appear to deadlock when pessimistically locking the submission row, even though the transaction that locked it has been closed for ~1s.
    Some psuedocode may help explain the problem. This is my DB polling thread
    while( true ) {
    Submission s = getNextSubmissionAndLockPessimistically();
    if( s == null )
    return null;
    Server s2 = getServerCapableOfRunning( s );
    if( s2 != null )
    return s2;
    uow.revertAndResume();
    I am worried that in the instance that a server capable of running the submission could not be found, or is too full, the UnitOfWork#revertAndResume method does not release the row lock for the submission. Are there any scenarios where this can occur?
    On another note, I occasionally receive "Query sent to unactivated UnitOfWork" exceptions during the uow.revertAndResume() call. My code only uses the first UnitOfWork returned by EntityManager#getUnitOfWork(). Could the two be related? Does anyone have any ideas on how to fix this exception?
    Thanks,
    Dan

    Thank you for the detailed description of how the locks are released; I mistakenly assumed the revertObject/revertAndResume would release them. I will refactor my code to create EntityManager/UnitOfWork instances in loop and release/close them instead of reverting.
    As for the "unactivated UnitOfWork" exception, here is one of my stack traces:
    Exception [TOPLINK-6027] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(my.package.ServerLimits)
    at oracle.toplink.essentials.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:893)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2217)
    at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
    at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:86)
    at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:76)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:90)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:193)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:315)
    at oracle.toplink.essentials.indirection.IndirectList.size(IndirectList.java:640)
    at oracle.toplink.essentials.internal.queryframework.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:184)
    at oracle.toplink.essentials.internal.indirection.TransparentIndirectionPolicy.getRealAttributeValueFromObject(TransparentIndirectionPolicy.java:252)
    at oracle.toplink.essentials.mappings.ForeignReferenceMapping.getRealAttributeValueFromObject(ForeignReferenceMapping.java:370)
    at oracle.toplink.essentials.mappings.CollectionMapping.getRealAttributeValueFromObject(CollectionMapping.java:559)
    at oracle.toplink.essentials.mappings.CollectionMapping.getRealCollectionAttributeValueFromObject(CollectionMapping.java:574)
    at oracle.toplink.essentials.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:734)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2096)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfOriginalIntoWorkingCopy(MergeManager.java:450)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:251)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.revertAndResume(UnitOfWorkImpl.java:3527)
    at my.package.DbInterface.getNextSubmissionAndServer(DbInterface.java:460)
    at my.package.PollingThread.waitForNextSubmission(PollingThread.java:175)
    at my.package.PollingThread.run(PollingThread.java:122)
    This particular error could be related to the DB lock obtained on the Server object, which has a One-To-Many relationship to the ServerLimits.
    However, there is another exception that I am worried about:
    Exception [TOPLINK-6027] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(my.package.Submission)
    at oracle.toplink.essentials.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:893)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2217)
    at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
    at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:86)
    at oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:76)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:90)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:160)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:232)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:90)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:193)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:315)
    at oracle.toplink.essentials.indirection.IndirectList.add(IndirectList.java:140)
    at my.package.db.Transaction.addSubmission(Transaction.java:422)
    at my.package.DbInterface.createNewSubmission(DbInterface.java:284)
    at my.package.EngineInterface.executeObjectFn(EngineInterface.java:446)
    at my.package.EngineInterface.executeBooleanFn(EngineInterface.java:412)
    at my.package.EngineInterface.search(EngineInterface.java:252)
    at my.package.mdb.RequestListenerBean.onMessage(RequestListenerBean.java:457)
    at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
    at RequestListenerBean_EndPointProxy_44242m8.onMessage(Unknown Source)
    at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:268)
    at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
    at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
    at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
    at java.lang.Thread.run(Thread.java:595)
    The code that caused this error is about as simple as it can get:
    EntityManager em = (EntityManager) emf.createEntityManager();
    UnitOfWork uow = em.getUnitOfWork();
    try
    // locate owning transaction and the RECEIVED_FROM_ESB type
    Transaction tx = locate( Transaction.class, em, uow, txId );
    ServerFunction fn = locate( ServerFunction.class, em, uow, fnId );
    TrackingType trackingType = locate( TrackingType.class, em, uow, TrackingType.RECEIVED_FROM_ESB );
    // create submission
    Submission submission = new Submission();
    submission.setPriority( priority );
    submission.setRequestId( requestId );
    submission.setNistId( nistId );
    submission.setFunction( fn );
    // create RECEIVED_FROM_ESB tracking status
    TrackingStatus status = new TrackingStatus();
    status.setTrackingType( trackingType );
    status.setStatusTime( new Timestamp( System.currentTimeMillis() ) );
    submission.addTrackingStatus( status );
    tx.addSubmission( submission );
    em.persist( submission );
    uow.commit();
    em.close();
    return submission.getId();
    finally
    if( uow.isActive() )
    uow.release();
    if( em.isOpen() )
    em.close();
    There is a One-To-Many mapping from Transaction to Submission, and a One-To-Many mapping from Submission to TrackingStatus.
    If anyone can offer any insight into what I'm doing wrong, I'd appreciate it!
    Thanks,
    Dan

  • Unit Of work upgrade issue 9.0.3- 10.1.4

    Hi,
    I recently upgraded from Toplink 9.0.3 to Toplink 10.1.3. I changed nothing in my code except the deployment java descriptor to use the new classes implemented instead of the deprecated classes. I also used the new TypeConversions for my CLOBs and BLOBs. Everything worked fine in my unit tests but then once I'd deployed the application into production my users kept on getting an irregular error. I can't reproduce the error myself as its so irregular. I have tracked it down to when my users enter a clob/blob of data into the database. The strange thing is that I close the unit of work and even test if its still active and I get false as an answer but somehow when I execute on the session it uses the UnitOfWork which has expired for some reason. I have checked my code and can't find anything that is changed.
    All my code basically always checks whether a UOW is active and if it is not it uses the session to execute the query. Here is a java code extract:
    if ( isTxActive() ) {
    objectResults = uow.readAllObjects(Class.forName(objectType), expression);
    objectResults = uow.registerAllObjects(objectResults);
    } else
    objectResults = session.readAllObjects(Class.forName(objectType), expression);
    I use the following setup:
    - Oracle 9i database
    - JDK 1.5
    - Oracle JDBC Thin Driver version - 10.1.0.2.0
    I have tried the following:
    - Specified my OraclePlatform i.e. Oracle9Platform
    - Tried playing around with the SQL String binding
    - Double checked my type conversions
    Below is my logfile output and also my login parameters and extract of one of my descriptors.
    Any help would be appreciated.
    I was wondering if there is a timeout on the UnitOfWork or if its multi-threaded hence my application doesn't wait for my CLOB to finish being written?
    Thanks in advance,
    Paula
    2006-05-24 11:32:05,870 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,871 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,871 (toplink) DEBUG - DatabaseAccessor(connected)--INSERT INTO chebi.AUTOGEN_STRUCTURES (ID, STRUCTURE_ID) VALUES (12599, 19211)
    2006-05-24 11:32:05,874 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,875 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,875 (toplink) DEBUG - DatabaseAccessor(connected)--INSERT INTO chebi.DEFAULT_STRUCTURES (ID, STRUCTURE_ID) VALUES (6968, 19213)
    2006-05-24 11:32:05,885 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,886 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,886 (toplink) DEBUG - DatabaseAccessor(connected)--INSERT INTO chebi.IMAGE_PRECOMPUTES (ID, FORMAT, IMAGE, STRUCTURE_ID) VALUES (7208, 'p
    ng', empty_blob(), 19213)
    2006-05-24 11:32:05,898 (toplink) DEBUG - DatabaseAccessor(connected)--SELECT IMAGE FROM chebi.IMAGE_PRECOMPUTES WHERE (ID = 7208) FOR UPDATE
    2006-05-24 11:32:05,905 (toplink) DEBUG - write_BLOB
    2006-05-24 11:32:05,905 (toplink) DEBUG - DatabaseAccessor(connected)--commit_transaction
    2006-05-24 11:32:05,915 (toplink) DEBUG - end_unit_of_work_commit
    2006-05-24 11:32:05,915 (toplink) DEBUG - release_unit_of_work
    2006-05-24 11:32:05,915 (controller.DatabaseAction) DEBUG - ModifyStructureAction_postprocess: empty method
    2006-05-24 11:32:05,915 (controller.DatabaseAction) DEBUG - ModifyStructureAction_findSuccess: start method
    2006-05-24 11:32:05,915 (controller.DatabaseAction) DEBUG - ModifyStructureAction_findSuccess: preparing forward ( set form | release lock | reset token )
    2006-05-24 11:32:05,915 (controller.DatabaseAction) DEBUG - ModifyStructureAction_findSuccess: forward to searchId
    2006-05-24 11:32:05,917 (toplink.ToplinkDAO) DEBUG - find(String objectType, String col, String val): start method
    2006-05-24 11:32:05,917 (toplink.ToplinkDAO) DEBUG - isTxActive: start method
    2006-05-24 11:32:05,917 (toplink.ToplinkDAO) DEBUG - isTxActive: false
    2006-05-24 11:32:05,917 (toplink) DEBUG - execute_query
    2006-05-24 11:32:05,917 (toplink) DEBUG - DatabaseAccessor(connected)--SELECT ID, SOURCE, ASCII_NAME, STATUS, CREATED_ON, DEFINITION, MODIFIED_BY, NAME, MODI
    FIED_ON, CREATED_BY, CHEBI_ACCESSION, MERGE_TYPE, PARENT_ID FROM chebi.COMPOUNDS WHERE (ID LIKE 6126)
    2006-05-24 11:32:05,980 (toplink) DEBUG - execute_query
    2006-05-24 11:32:06,046 (handlers.DefaultExceptionHandler) ERROR - Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): ora
    cle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(uk.ac.ebi.chebi.compounds.model.CompoundName)
    uk.ac.ebi.chebi.compounds.application.curator2.exceptions.BeanUtilException: Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060
    118)): oracle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(uk.ac.ebi.chebi.compounds.model.CompoundName)
    LOGIN:
    public void applyLogin () {
    DatabaseLogin login = new DatabaseLogin();
    login.usePlatform( ToplinkDeploymentHelper.getPlatform(options) );
    login.setDriverClassName(options.getDriver());
    login.setConnectionString(options.getDbUrl());
    login.setUserName(options.getDbUserName());
    login.setPassword(options.getDbPassword());
    // Configuration properties.
    // login.setUsesNativeSequencing(true);
    // login.setSequencePreallocationSize(100);
    // Replace with
    login.setDefaultSequence(new NativeSequence("", 1));
    login.setShouldBindAllParameters(false);
    login.setShouldCacheAllStatements(false);
    // String binding is used when the SQL string might be too large to
    // incorporate in the Oracle Thin driver. It will give an exception of string literal
    // too long. Hence string binding should be turned on for long strings such
    // as long names
    login.setUsesStringBinding(true);
    login.useStringBinding( );
    // This specifies for large bytes to use binding to prevent the same problem
    // above and improve performance
    login.setUsesByteArrayBinding(true);
    if ( login.shouldUseByteArrayBinding() ) { // Can only be used with binding.
    login.setUsesStreamsForBinding(false);
    login.setShouldForceFieldNamesToUpperCase(false);
    login.setShouldOptimizeDataConversion(true);
    login.setShouldTrimStrings(true);
    login.setUsesBatchWriting(false);
    if ( login.shouldUseBatchWriting() ) { // Can only be used with batch writing.
    login.setUsesJDBCBatchWriting(true);
    login.setUsesExternalConnectionPooling(false);
    login.setUsesExternalTransactionController(false);
    setLogin(login);
    ImagePrecompute descriptor:
    public ClassDescriptor buildImagePrecomputeDescriptor () {
    ClassDescriptor descriptor = new ClassDescriptor();
    descriptor.setJavaClass(uk.ac.ebi.chebi.compounds.model.ImagePrecompute.class);
    descriptor.addTableName( options.getDbSchemaName().concat(".").concat("IMAGE_PRECOMPUTES") );
    descriptor.addPrimaryKeyFieldName("IMAGE_PRECOMPUTES.ID");
    descriptor.useSoftCacheWeakIdentityMap();
    descriptor.setIdentityMapSize(50);
    descriptor.useRemoteNoIdentityMap();
    //descriptor.useRemoteSoftCacheWeakIdentityMap();
    //descriptor.setRemoteIdentityMapSize(100);
    descriptor.setSequenceNumberFieldName("IMAGE_PRECOMPUTES.ID");
    descriptor.setSequenceNumberName("image_precompute_sequence");
    descriptor.setAlias("ImagePrecomputes");
    descriptor.getQueryManager().checkCacheForDoesExist();
    DirectToFieldMapping idMapping = new DirectToFieldMapping();
    idMapping.setAttributeName("id");
    idMapping.setFieldName("IMAGE_PRECOMPUTES.ID");
    descriptor.addMapping(idMapping);
    OneToOneMapping structureMapping = new OneToOneMapping();
    structureMapping.setAttributeName("structure");
    structureMapping.setReferenceClass(uk.ac.ebi.chebi.compounds.model.Structure.class);
    structureMapping.dontUseIndirection();
    structureMapping.addForeignKeyFieldName("IMAGE_PRECOMPUTES.STRUCTURE_ID", "STRUCTURES.ID");
    descriptor.addMapping(structureMapping);
    DirectToFieldMapping imageMapping = new DirectToFieldMapping();
    imageMapping.setAttributeName("image");
    imageMapping.setFieldName("IMAGE_PRECOMPUTES.IMAGE");
    TypeConversionConverter imageMappingConverter = new TypeConversionConverter(imageMapping);
    imageMappingConverter.setObjectClass(byte[].class);
    imageMappingConverter.setDataClass(java.sql.Blob.class);
    imageMapping.setConverter(imageMappingConverter);
    descriptor.addMapping(imageMapping);
    DirectToFieldMapping formatMapping = new DirectToFieldMapping();
    formatMapping.setAttributeName("format");
    formatMapping.setFieldName("IMAGE_PRECOMPUTES.FORMAT");
    descriptor.addMapping(formatMapping);
    return descriptor;
    Message was edited by:
    pmatos

    Hi,
    Thanks for replying.
    I use log4j to log my toplink info so that I can write it to a file so that is why I have no session info. If you think it is will be useful then I will try to include it in my tool so that it can be reproduced.
    In the mean time here is the stacktrace:
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(uk.ac.ebi.chebi.compounds.model.CompoundName)
    uk.ac.ebi.chebi.compounds.application.curator2.exceptions.BeanUtilException: Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(uk.ac.ebi.chebi.compounds.model.CompoundName)
         at uk.ac.ebi.chebi.compounds.application.curator2.controller.helper.BeanAssembler.populateCompoundBean(Unknown Source)
         at uk.ac.ebi.chebi.compounds.application.curator2.controller.search.SearchIdAction.loadCompound(Unknown Source)
         at uk.ac.ebi.chebi.compounds.application.curator2.controller.search.SearchIdAction.executeLogic(Unknown Source)
         at uk.ac.ebi.chebi.compounds.application.curator2.controller.BaseAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
         at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
         at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: Exception [TOPLINK-6027] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.QueryException
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(uk.ac.ebi.chebi.compounds.model.CompoundName)
         at oracle.toplink.exceptions.QueryException.querySentToInactiveUnitOfWork(QueryException.java:816)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2530)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:981)
         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:184)
         at oracle.toplink.indirection.IndirectList.getDelegate(IndirectList.java:307)
         at oracle.toplink.indirection.IndirectList.size(IndirectList.java:632)
         at java.util.ArrayList.<init>(ArrayList.java:133)
         at uk.ac.ebi.chebi.compounds.model.Compound.getAllCompoundNameList(Unknown Source)
         at uk.ac.ebi.chebi.compounds.application.curator2.controller.helper.BeanAssembler.populateAllNames(Unknown Source)
         ... 51 more

  • Message Transmission Transport Exception in B2b 11g

    Hello b2bgurus,
    I am working on a outbound flow using RosettaNet exchange protocol. The message sent from oracle b2b reach remote TP. But the the state of the message is MSG_ERROR. We get exception message as response from remote TP.
    In the logs i noticed few error messages like
    Message Transmission Transport Exception
    Transport Error Code is OTA-HTTP-SEND-1005
    StackTrace oracle.tip.b2b.transport.TransportException: [IPT_HttpSendConnectionRefused] HTTP connection is refused.
         at oracle.tip.b2b.transport.TransportException.create(TransportException.java:94)
    [2011-03-31T05:52:19.197-06:00] [soa_server1] [NOTIFICATION] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] B2B Label:PCBPEL_11.1.1.3.0_GENERIC_RELEASE: Informational -: B2B-50025: Repository error: Exception [TOPLINK-6027] (Oracle TopLink - 11g Release 1 (11.1.1.3.0) (Build 100323)): oracle.toplink.exceptions.QueryException[[
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(oracle.tip.b2b.model.instance.BusinessMessage)
    [2011-03-31T05:52:19.249-06:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.transport] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] Problem getting Queue Table for Queue : IP_IN_QUEUE
    [2011-03-31T05:52:19.259-06:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.transport] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] [IPT_MsgCannotBeSent] AQ message cannot be sent.
    [2011-03-31T05:52:19.259-06:00] [soa_server1] [WARNING] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] [[
    Message Transmission Exception
    Transport Error Code is OTA-AQ-1001
    StackTrace oracle.tip.b2b.transport.TransportException: [IPT_MsgCannotBeSent] AQ message cannot be sent.
         at oracle.tip.b2b.transport.TransportException.create(TransportException.java:94)
    [2011-03-31T05:52:19.260-06:00] [soa_server1] [NOTIFICATION] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] B2B Label:PCBPEL_11.1.1.3.0_GENERIC_RELEASE: oracle.tip.b2b.transport.TransportException: [IPT_MsgCannotBeSent] AQ message cannot be sent.[[
         at oracle.tip.b2b.transport.TransportException.create(TransportException.java:94)
    [2011-03-31T05:52:19.261-06:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@142219e7] [userId: <anonymous>] [ecid: 0000IwBjgzpESOTuu8bADH1D_56O00011A,0] [APP: soa-infra] [dcid: a65da66a7bc245f6:-2f10c1aa:12f0b5fe6be:-7ffd-0000000000001b8f] Informational -: B2B-50025: Repository error: oracle.tip.b2b.transport.TransportException: [IPT_MsgCannotBeSent] AQ message cannot be sent.[[
         at oracle.tip.b2b.msgproc.DbAccess.enqueueIPMessage(DbAccess.java:4485)
    Caused by: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: Transaction rolled back: Transaction timed out after 30 seconds
    BEA1-7C72C9CF4888E08EC522
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1609)
    Caused by: weblogic.transaction.TimedOutException: Transaction timed out after 30 seconds
    BEA1-7C72C9CF4888E08EC522
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1607)
    Informational -: B2B-50025: Repository error: oracle.tip.b2b.transport.TransportException: [IPT_MsgCannotBeSent] AQ message cannot be sent.
         at oracle.tip.b2b.msgproc.DbAccess.enqueueIPMessage(DbAccess.java:4485)
         at oracle.tip.b2b.msgproc.Notification.deliverException(Notification.java:1298)
    Caused by: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: Transaction rolled back: Transaction timed out after 30 seconds
    BEA1-7C72C9CF4888E08EC522
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1609)
    Though im in middle of testing, just curious to know about these errors.. Have anybody faced this kind of issues? I saw few forums abt B2B-50025: error. Please let me know how to debug these issues

    I see two exceptions here -
    Message Transmission Transport Exception
    Transport Error Code is OTA-HTTP-SEND-1005
    StackTrace oracle.tip.b2b.transport.TransportException: [IPT_HttpSendConnectionRefused] HTTP connection is refused.
    at oracle.tip.b2b.transport.TransportException.create(TransportException.java:94)This exception has occured while transmitting the document to Trading Partner perhaps on HTTP endpoint. From the error it seems, HTTP endpoint was not available when Oracle B2B tried to send the message to it.
    The message sent from oracle b2b reach remote TPBy default Oracle B2B retries 3 times to deliver a message. Perhaps it failed to send the document in first or second attempt but could send it in later attempt(s) and that's why your TP have received the message.
    But the the state of the message is MSG_ERROR. We get exception message as response from remote TP.That's why your request message has been marked as error. Check the exception response detail and try to find why your TP's B2B sending exception response. If you are not able to identify the exact issue why exception response came back, ask your TP. You may also paste the exception response content here if you need any help from us.
    Exception Description: Query sent to a unactivated UnitOfWork.
    Query: ReadAllQuery(oracle.tip.b2b.model.instance.BusinessMessage)This exception is coming after first exception and it is coming because Oracle B2B is trying to enqueue the exception message to IP_IN_QUEUE but transaction has already timed out. For this you need to increase the JTA timeout value. By default it gets set to 30. Try after increasing it to 150
    For increasing JTA timeout value, login to Weblogic Admin Console as admin user, click on the domain name in Domain Structure at left side of page, in configuration tab goto JTA subtab and set the value of "Timeout Seconds" from 30 to 150. Save the change and retest your configuration. You should not see this exception any more.
    Regards,
    Anuj

  • Using a registered object outside a UnitOfWork

    We are constructing a multi-tiered application using TopLink 4.6. The Model and Controller are in different JARs but are part of the same EAR. Data objects mapped in TopLink are sent by the Model to the Controller. The Controller may modify these objects locally, and send them back to the Model for persisting.
    When the Controller makes a request for a data object to the Model, the Model does the following -
    1. Gets the object from the TopLink cache through a query
    2. Gets a UnitOfWork
    3. Registers the object with the UnitOfWork to get the clone
    4. Releases the UnitOfWork
    5. Returns the clone to the Controller
    I am registering the object with a UnitOfWork, even though I am not modifying it in that UnitOfWork.
    I have to do this because the object model is very complicated. The Controller needs access to the root object, and also all of its nested parts. Using this technique, I retain the benefit of Indirection. The other option is to use a ObjectCopyingPolicy, but that is expensive as the Model is forced to do a cascadeAll copy. Also, I cannot send back the original object returned by the query because this object comes from the cache, and the Controller could end up modifying it, thus causing possible data inconsistency.
    After the Controller sends back the modified object, the Model now does the following -
    1. Check the incoming object and perform business validations
    2. Get a UnitOfWork
    3. Do a deepMergeClone on the UnitOfWork to save the object.
    4. Commit or release the UnitOfWork
    This seems to work without any problems. Will this have any other repercussions? The object is initially obtained through a different UnitOfWork, and is saved using a different UnitOfWork.
    Is there a better way of handling this situation?
    Thanks

    Hi,
    The key here is that the object is cloned (copied) and the clone (copy) is returned to the client.
    The client then makes the changes to the copy (the original is still in the session cache and has not changed)
    When the object is register, TopLink does a look-up, using the copy Object, in the session to find the original object, it then makes a clone of the original object.
    You now have three copies of the same object. The Original Object (no changes), the clone of the Original Object (no changes yet), and the copy Object (with client changes).
    The next step merges the Original Object Clone (without changes) and the copy Object Clone (with changes).
    Now your system has two copies, The Original Object (no changes) and the clone Object (with changes).
    Now on commit, TopLink compares the Original with the Clone and updates the DB.
    Raanan.

  • SQL sent to database in obiee 10g

    Hi,
    I am unable to see the SQL Query sent to Database in log file. Ony able to logical query. I have logged inwith Administrator and checked th eloglevel is 5.
    How can I see the general sql query which was sent to database.
    Thanks

    Hi Srini,
    Thanks for the reply.
    I have cleared the cache in admintool (purge) and tried generating the report. In advanced tab also I have selected the option "Bypass Oracle BI Presentation Services Cache". It seems its because of Cache, able to see the databse query now.
    Could you please explain how can I do this.
    This would be with no other changes or use set variable disable_cache_hit=1;
    How can I see the database query always.
    Thanks.

  • Distributed Query Overhead

    Hi All,
    I have a distributed deployment of two oracle instances where database A keeps a replication of a schema from database B.
    I have A and B linked together, B sees A as a remote database, and my application sends queries to database B.
    Let's say I have the following two queries:
    The following is issued to B:
    select * from magic.accountejb@A a where a.profile_userid = ( select userid from magic.accountprofileejb@A ap where ap.userid = 'uid:174')
    and the following issued directly to A (which is basically the same query as above):
    select * from accountejb a where a.profile_userid = ( select userid from accountprofileejb ap where ap.userid = 'uid:174')
    when I measure the time through my Java application, the second query executes more than 3 times faster than the first query (23ms on A compared to 80ms on B). However, when I use the sqlplus client on B to issue the exact same query, the execution time reported by sqlplus is almost identical to the second one(20ms).
    When I monitor the execution plan through *@UTLXPLAN*, it seems like the query sent to B is also fully executed remotely and on A. with a network latency of 11ms between A and B, I am not sure why I see such a long delay for the first query. Also playing with DRIVING_SITE did not have any perceived effect on improving performance.
    I wonder if anybody has any explanation for the difference I see? is a distributed query really 3 times slower than a regular query even though both are pretty much handled by the same database engine? or is it so that I need some other sort of tuning?
    Any thoughts or advice on how I can achieve comparable performance is highly appreciated.
    thanks!
    Edited by: 944957 on 16-Nov-2012 20:25
    Edited by: 944957 on 16-Nov-2012 20:29

    Thanks a lot for the quick response:
    rp0428 wrote:
    1. the 4 digit Oracle version (or other DB version)
    2. the JDK version
    3. the JDBC jar name and versionI am using ojdbc14 with Oracle 11g XE and JDK 7.
    4. the code you are using that shows an issue or problem.The queries I am using is basically the two queries I provided earlier, and here is the exact Java code. I loop over the code below 20 times and discard the first two retrieved results for each query and calculate an average on the remaining 18 results collected.
    static Connection c1 = null, c2 = null;
    static Statement _session;
    public void getStats(){
    long start;
    for (int i = 0; i < 20; i++) {
    c1 = (c1 != null) ? c1 :
         DriverManager.getConnection("jdbc:oracle:thin:@//" + System.getProperty("host.1")+"/XE", "magic", "magic");
    _session = c1.createStatement();
    session.executeUpdate("ALTER SESSION SET CURRENTSCHEMA=magic");          
    start = System.currentTimeMillis();
    _session.executeUpdate(query);
    values[0] = System.currentTimeMillis() - start;     
    _session.close();
    c2 = (c2 != null) ? c2 :
         DriverManager.getConnection("jdbc:oracle:thin:@//" + System.getProperty("host.2")+"/XE", "magic", "magic");
    _session = c2.createStatement();
    _session.executeUpdate("ALTER SESSION SET CURRENT_SCHEMA=magic");          
    start = System.currentTimeMillis();
    _session.executeUpdate(distQuery);          
    values[1] = System.currentTimeMillis() - start;     
    _session.close();
    } // end for loop     
    } // end method
    5. for performance related issues - the data volume being queried or processedThe data volume is rather small. I measure the data and it is roughly about 10K of data transfer.
    >
    Without seeing the code to see how you are measuring the timing it is hard to comment on what you posted.
    3. How was the timing computed in sql*plus?for sqlplus, I issue *set timing on* prior to executing the queries.
    4. Were the connections already created before the timing started? Or is the creation of the connection part of the timing result?As you see in the code, the connection is only created the first time I issue a query, and I discard the results of the first two queries using the connection as the timing is far off specially for the first query. I think the first query also download some metadata information that I don't consider in calculating the performance.
    5. Do the timings include the retrieval of ALL result set data? Or just the first set of results?the time only consists of executing the first set.
    Can you post the explain plans for the java and the sql*plus executions?Here is the results of the explain plan
    PLAN_TABLE_OUTPUT
    Plan hash value: 3819315806
    | Id | Operation          | Name          | Rows | Bytes | Cos
    t (%CPU)| Time     | Inst |
    PLAN_TABLE_OUTPUT
    | 0 | SELECT STATEMENT REMOTE |               |     1 |     43 |
    2 (0)| 00:00:01 |     |
    | 1 | TABLE ACCESS BY INDEX ROWID| ACCOUNTEJB     |     1 |     43 |
    2 (0)| 00:00:01 | CORONA |
    |* 2 | INDEX RANGE SCAN     | ACCOUNT_USERID     |     1 |     |
    1 (0)| 00:00:01 | CORONA |
    |* 3 | INDEX UNIQUE SCAN     | PK_ACCOUNTPROFILEEJB |     1 |     9 |
    0 (0)| 00:00:01 | CORONA |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    2 - access("A1"."PROFILE_USERID"= (SELECT "A2"."USERID" FROM "MAGIC"."A
    CCOUNTPROFILEEJB"
    PLAN_TABLE_OUTPUT
         "A2" WHERE "A2"."USERID"='uid:174'))
    3 - access("A2"."USERID"='uid:174')
    Note
    - fully remote statement
    Edited by: 944957 on 16-Nov-2012 20:51
    Edited by: 944957 on 16-Nov-2012 20:53
    Edited by: 944957 on 16-Nov-2012 20:55
    Edited by: 944957 on 16-Nov-2012 20:56
    Edited by: 944957 on 16-Nov-2012 20:57
    Edited by: 944957 on 16-Nov-2012 20:59

  • Successive dates with  last day of that month being added to succesive date

    Hi ,
    I have a piece of code that displays the succuessive dates from the given date to tilll date with a date interval of 30 days. My requirement goes some thing like this. since the given date is '26-nov-08' the next successive date should be the number of days in nov(30) added to '26-nov-08'. that will be around 26-dec-08. For this date it has to add the number of days in December(31) to '26-dec-08' and that turns out to be '26-jan-09'. and this must go on till date.
    In the below code i have used 30 for the interval of 30 days but the interval has to the last day of the successive date's month( for dec the interval has to 31 and for january the interval has to be 31 and for february 28)
    select to_date('26-nov-08', 'dd-mon-yy') + (level - 1) * 30
    from dual
    connect by level <= trunc((sysdate-to_date('26-nov-08', 'dd-mon-yy'))/30 )Please advice

    hi ,
    the query sent by you is correct and could it be in corporated for this query :
    SELECT TRUNC(inst_due_date) + (LEVEL-1 ) * (ilpa_term_type),iloan_code,LOAN_AMT,FEE_AMT,
    LOAN_DATE,LOAN_STATUS_ID
    FROM (
    SELECT inst_due_date,sm.iloan_code,LOAN_AMT,
    FEE_AMT,
    LOAN_DATE,
    LOAN_STATUS_ID,
    decode(sm.ilp_term_type, 26 ,14,24,15,12,(select to_number(to_char(last_day(inst_due_date),'dd')) from dual)) as ilpa_term_type
    FROM ST_IL_SCHEDULE sc,ST_IL_MASTER sm
    WHERE sc.iloan_code = sm.iloan_code
    AND sc.inst_num = (SELECT MAX(inst_num) FROM ST_IL_SCHEDULE b WHERE b.iloan_code = sc.iloan_code)
    AND sc.iloan_code =123456789)
    CONNECT BY LEVEL <= TRUNC((TRUNC(SYSDATE)-TRUNC(inst_due_date))/(ilpa_term_type) )
    Here we are using the decode concept if ilp_term_type = 26 then 14 but we need to implement the code of adding the number of days to that month in place of this code :
    select to_number(to_char(last_day(inst_due_date),'dd')) from dual:
    Please advice

  • Reg: Excluded Section in Pivot view

    Hi,,
    can any one telme..
    how exactly the 'Excluded Section' in the pivot view, will effect the entire report.
    In one of my report when i place one column in excluded section, one set of data is coming, when i remove that column in the Excluded section , data is effecting and its changing...why this is happening??

    Even if the column is excluded in pivot, it will be there in the query sent to database. If you exclude an attribute, and if it changes the granularity of the report, you have to make sure you set aggregations properly in pivot measures, otherwise you can get unexpected results, and individual row level or even grand totals.
    Edited by: A. Kumar on Apr 2, 2013 1:26 PM

  • Intermittent problems with iphone 3g "charging not supported"

    I notice quite a few complaints about intermittent 'charging not supported' messages.
    I have been getting the same message on my iphone 3g.
    I have ELIMINATED the cord and plug as the problem in this case by the following method:
    I found that by LOWERING the line voltage to the charger with a variac, I could get rid of the message RELIABLY for a period of time.
    By turning the variac off and on, and by varing the voltage setting, I can reproduceably get either charging or 'charging not supported'.
    Since there are no changes being made in the connections to the phone and charger, I eliminate them as causing to the problem.
    I suspect a deteriorating component in the charger is reporting some kind of error to the phone via some communications channel.
    I have not tried opening the charger, but if and when it finally dies, I will do so.
    This morning, the charger worked with the variac set to 80 volts.
    Anyone on the design team around that can suggest other tests?
    -bz-

    The unit finally failed and I opened it up. It appears to consist of an AC-->dc converter with suitable filters and regulators and a small computer that probably talks via I2C or a similar protocol to the iphone.
    I suspect that components are defective and the output voltage is outside the range it thinks it should be or some problems with the communications cause it to send an erronious message in response to the query sent by the iphone. I did NOT see any obviously bulging electrolytic capacitors, but I did not test for high ESR and I suspect that is the problem.
    A 'off brand' AC Charger of iPod and iPhone from Radio Shack works fine while BOTH authentic APPLE iphone 'tiny cube' chargers are going for recycling.
    Software fixes may cause the iphone to either keep trying until it gets the right response or ignore the erronious responses.

  • Iphone 3g problems with charging

    After charging my phone, I unplug it and I can't hear any sound coming out of it. I check my settings, everything is on.

    The unit finally failed and I opened it up. It appears to consist of an AC-->dc converter with suitable filters and regulators and a small computer that probably talks via I2C or a similar protocol to the iphone.
    I suspect that components are defective and the output voltage is outside the range it thinks it should be or some problems with the communications cause it to send an erronious message in response to the query sent by the iphone. I did NOT see any obviously bulging electrolytic capacitors, but I did not test for high ESR and I suspect that is the problem.
    A 'off brand' AC Charger of iPod and iPhone from Radio Shack works fine while BOTH authentic APPLE iphone 'tiny cube' chargers are going for recycling.
    Software fixes may cause the iphone to either keep trying until it gets the right response or ignore the erronious responses.

  • In your experience

    I was going to post the link here but then I would be advertising and that is not my idea, so I decided to just post the content of the course.
    In your experience would you say that this is a good course for me to start with:? I do not have any back ground in programming but I am king to learn.
    In total this is a 5 day course based in London.
    Course Content
    Module 1 - Getting Started
    Origins of the language and its key features
    Describing the Java Runtime Environment and the components of the Java 2 Standard Edition (J2SE)
    Comparing local and distributed Java applications and associated security features
    Writing, compiling and running a simple Java application
    Using documentation for the J2SE class libraries
    Module 2 - Object-Oriented Programming
    Defining classes, objects, variables and methods
    Building an object and understanding object references and garbage collection
    Using constructor methods to initialise objects
    Using package and import statements to access the J2SE class libraries
    Applying access modifiers to object members
    Module 3 - Keywords and primitive types
    Recognizing Java Keywords
    Listing the eight primitive types
    Understanding conversion and casting of primitive types
    Recognizing and using Java operators
    Module 4 - Flow Control
    Iteration using for loops, while loops and do-while loops
    Building nested loops, and breaking out of a loop
    Using labels and the continue keyword
    Building alternative execution paths with a switch block
    Module 5 - Arrays
    Declaring, creating and initialising arrays of primitive types
    Building arrays of objects
    Building multi dimensional arrays
    Passing arguments into the main method of a command line application
    Building an application that uses arrays, method calls and iterative loops
    Module 6 - Object-Oriented design
    Describing the three pillars of object-oriented design (Inheritance, Polymorphism and Encapsulation)
    Inheritance and building a derived class
    Understanding a class hierarchy and the methods of the Object class
    Describing polymorphism and building an overriding method
    Enforcing polymorphism with interfaces and abstract classes
    Encapsulation and its advantages in producing maintainable code
    Module 7 - Further Class Features
    Building overloaded methods and constructors
    Declaring and using static variables and methods
    Declaring and using final classes, variables and methods
    Module 8 - Exceptions
    Defining exceptions and building code to handle a runtime exception
    Explaining the Exception class hierarchy and categories of exceptions
    Declaring methods that may throw exceptions
    Using the throw keyword forward an exception
    Building a user-defined Exception class
    Module 9 - Collections
    Categorising collections classes by the interfaces that they implement
    Using Sets, Lists and Maps to store collections of objects at runtime
    Building an iterator to access the objects in a Set
    Adding key - value pairs to a HashMap
    Using object reference casting when assigning references from a collection
    Module 10 - Building a Graphical User Interface (GUI)
    Describing the Swing package and its components
    Building an application window and adding components to the Content Pane
    Explaining layout managers and the rules by which they position components on a window
    Using BorderLayout, FlowLayout, GridLayout and GridBagLayout managers
    Building inner classes to handle events in a GUI , such as a menu selection
    Adding a user interface to the command line application built during previous modules
    Module 11 - Applets
    Comparing GUI applications to applets
    Explaining applet methods that are called by the browser
    Writing HTML code to display an applet within a web page
    Executing a Java 2 applet on any browser by automatically downloading the Java Runtime Environment
    Using the paint method to draw an image on a component
    Module 12 - Threads
    Creating threads to enable concurrent execution of multiple tasks
    Declaring synchronized code to prevent simultaneous access to a method by more than one thread
    Moving threads between states using the wait and notify methods
    Using a shared object to communicate between threads
    Module 13 - I/O Streams
    Interrogating the local file system
    Using Character Streams to read and write to a text file
    Understanding processing streams and linking them to sink streams
    Building byte streams to send and receive binary data
    Using object serialization to give persistence to objects
    Module 14 - Networking
    Distinguishing between Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
    Translating between character streams and byte streams
    Building a Server application that listens on a specified port
    Building a Client application that establishes a connection with the Server and sends some text
    Following by the second part :
    Course Content
    Module 1 - Java Database Connectivity (JDBC)
    Describing the JDBC architecture
    JDBC driver categories, including the JDBC-ODBC bridge and Type 4 drivers
    Establishing a database connection
    Creating and updating a database table
    Using batch updates and prepared statements
    Querying a database and extracting metadata
    Using record locking and committing or rolling back a transaction
    Handling SQL exceptions and obtaining the SQL state for single and chained exceptions
    Module 2- The Java API for XML Processing (JAXP)
    Explaining XML Document structure, namespaces and Document Type Definitions
    Parsing XML data with the Simple API for XML Parsing (SAX)
    Parsing XML data with the Document Object Model (DOM) and navigating through the DOM
    Writing code to read an XML file into a database table
    Reading a ResultSet from an SQL query into an XML DOM
    Transforming an XML document using an XSL stylesheet
    Module 3- Adding a Swing User Interface to the database application
    Defining Model-View-Controller architecture
    Using UML class diagrams to describe the types of objects in an application and their static relationships
    Building a GUI using ?drag and drop? and understanding the underlying code
    Using a TableModel object to parse and display XML data in a JTable
    Building a client-side Controller object to interact with the database
    Displaying input dialogs and message dialogs
    Module 4- Remote Method Invocation
    Describing the RMI architecture and the alternatives to RMI
    Listing the steps involved in developing applications using RMI
    Defining and implementing a remote interface
    Generating stubs, starting the registry and registering objects
    Looking up a remote object using the RMI protocol
    Dynamically loading and instantiating class files from a web server
    Implementing security with a policy file
    Creating worker threads for time-consuming tasks
    Module 5- Servlets and Web containers
    Explaining the purpose and structure of a Servlet, and deploying a Servlet in a Web Container
    Writing a Servlet that will return XML data from an SQL query sent over HTTP from a Web client.
    Adding code to enable the Servlet to be accessed from the Swing application client built during previous modules
    [ Note that, while Servlets are part of the Java 2 Enterprise Edition, this module may be useful to delegates who intend to deploy Java applications in a Web Container provided by their Internet Service Provider ]
    Many thanks for any comment reagarding my query.
    Kind Regards,

    There's no game development!

Maybe you are looking for

  • Open and close window

    Due to issues getting Google maps to work from within Edge Animate using jquery-ui-map I have resorted to loading a new HTML page containing the map. Is there a way that I can open the new window containing the Google map leaving the Edge page behind

  • Crystal Reports - Charts do not appear on reports in some cases

    We have a few reports that include charts on them (created with Crystal 2008 Designer).  These reports have run fine for quite a while but this morning we got a support call with a client reporting that though the reports process and appear correctly

  • How can we clone the Oracle database in new Oracle Home

    Hi, I would like to clone oracle database into new oracle home. How can we set it using OEM. I am using 10g grid control. Target db is on solaris Thanks Naveen

  • ESS Personal Profile - Employee photo show as 'x'

    Dear experts I'm trying to find a conf. table the difference between Dev & QA to display employee photo in ESS personal profile. An image like hide photo (Not a actual employee photo) is display in Dev portal where as it show 'X' in QA. I'm trying to

  • Enough - Get specif

    I don't understand this mob mentality crap that's arisen in the last couple days, apparently everyone's acting like there are no drivers for Vista. Well surprise: Filename: [size="2" color="#3300ff">SBXF_PCDRV_LB_2_5_0006.exe This download is a drive