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.

Similar Messages

  • 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

  • [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?

  • UnitOfWork commit and transparent indirection issue

    During UnitOfWork commit I get the following exception:
    EXCEPTION [TOPLINK-150] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DescriptorException
    EXCEPTION DESCRIPTION: The mapping for the attribute [regions] uses transparent indirection so the attribute [regions] must be initialized to an appropriate container. Currently the value is [null].
    - JDK 1.1.x: an instance of IndirectList, IndirectMap or Hashtable, or one of their subclasses.
    - JDK 1.2 or higher: an instance of an implementor of Collection or Map.
    MAPPING: oracle.toplink.mappings.OneToManyMapping[regions]
    DESCRIPTOR: Descriptor(ru.v6.marslcc.model.directories.RegionGroup --> [DatabaseTable(DIRECTORY), DatabaseTable(REGION_GROUP)])
    I've try to use validateObjectSpace(), but it returns successfully.
    When I turn indirection off all works fine.
    What am I doing wrong?

    In your code make sure regions is a Collection type.
    ie: Collection regions = new ArrayList();
    In the mapping workbench, ensure that you haven't changed the collection type to be something other than IndirectList under the Collection Options.
    Darren

  • Transparent indirection

    We have set transparent indirection on 1-M mappings. Is this required that getXXX() be called to trigger population of this attribute. Just wondering as sometimes somehow its not happening ...

    No, any operations on the collection, when transparent indirection is being uses, will cause the untriggered indirection to trigger.
    In what situations are you seeing the indirection not trigger?
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 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

  • Oracle Transparent Gaeway Query

    Hello Experts,
    I am looking for a help here for the Oracle Transparent Gateway :
    My objective is :
    I have an EBPP application running on Jboss with SQL Server 2005.
    Here are the details:
    JDK 1.4
    JBoss 3.2.5
    SQL Server 2005
    I would like to migrate it to Oracle 11g R2. I dont want to touch my application to make it compatible with Oracle. I would like to keep the SQL server drive and queries as it is. As far as i see, I have only one option.
    One Go fo Oracle Transparent Gateway Way -
    Migrate whole database of SQLserver 2005 to Oracle.
    Shutdown the SQL server and install Oracle transparent gateway
    Point the application to oracle transparent gateway.
    Application will talk to oracle database via oracle transparent.
    Upgrade application for oracle
    Going with this, i have to upgrade so many things like JDK, JBoss and whole application.
    Please advise, if you see a better approach to tacke this issue.
    Thanks
    Regards,
    Zeeshan Qureshi

    user1703057 wrote:
    I have an EBPP application running on Jboss with SQL Server 2005.
    Here are the details:
    JDK 1.4
    JBoss 3.2.5
    SQL Server 2005
    I would like to migrate it to Oracle 11g R2. I dont want to touch my application to make it compatible with Oracle. I would like to keep the SQL server drive and queries as it is. As far as i see, I have only one option.
    One Go fo Oracle Transparent Gateway Way -
    Incorrect. The Oracle Transparent Gateway is for the Oracle server to connect to the foreign server via a database link. This enables Oracle SQL and PL/SQL code to access a foreign database from the current Oracle database, by using a heterogeneous database link.
    Sybrand raised a critical issue. Oracle != SQL-Server.
    There are some fundamental and core differences between the two products. This means that a SQL-Server application will not be able to use Oracle optimally and scale accordingly - and that the application needs to be refactored.
    What about this so-called +"the database is a black box+" approach that allows the database layer to supposedly be swap in and out for different database products - without having to touch the application?
    A bunch of bull. For the black box approach to be used means developing the application to the very lowest common denominator that are supported by all RDBMS products. The lowest common denominator changes the RDBMS into a simplistic record-and-file architecture - using less than 5% of the actual capability of the RDBMS product. A total waste of technology and costs. One just as well could look at not using a RDBMS at all and simply roll the basic functionality in the app layer itself.
    Your basic problem in my view is a conceptual one.
    Applications are a dime a dozen. New code gets bashed out all the time. Applications are swapped in and out. Are upgraded. Are changed. There is a saying that if an application does not change, it is dead as it is no longer servicing business needs and growth and changes in the business and the market.
    What remains fairly consistent and stable and constitutes the core, is the data. Simple example. What is important? The spreadsheet software or the spreadsheet data? Whether the spreadsheet s/w is Excel or Open Office or whatever - that is not what is important for the sales guy doing his sales projections. The actual spreadsheet and data are critical.
    So it is about the data. Not about the application.
    So your task is to make sure that the data layer is robust and consistent. Is performant and scalable. Is reliable. Is secure. And then put the application on top of that data layer.
    It is not designing the application totally separate from the data layer and expect to simply swap one data layer for another and that the application will still fit and use that data layer correctly and optimally. (unless your an ISV doing a truly independent RDBMS s/w product, in which case you need to design and write a very large and very complex data access layer that can deal correctly with the specific data layer in use - and no, smelly stuff like Hibernate is not it)

  • FWSM Transparent firewall query

    Customer has over 50 vlans with fwsm inside as below.
    WAN --- MSFC ---IDSM-2 --- FWSM --- Inside network (multiple vlans)
    Customer wants all internal vlan communication to be inspected by FWSM. What will be the best option - transparent firewall or routed mode and how will this work?
    Regards
    Vinod

    Hi Jon,
    Thanks for your valuable suggestion.
    My customer has FWSM IDSM and NAM module with 6500 switch and has the following requirement.
    1- Inter VLAN communication needs to be protected by FWSM and IDSM (only inline mode). I have never seen IDSM-2 with inline setup in any of my previous HLD's.
    2- Customer has collapsed core architecture with access switches terminating at 6509 directly to FWSM (facing inside). With FWSM running inside, I only have 2 options for redundancy. Either use routed mode and run ospf at the access layer (eigrp not supported on FWSM) or run FWSM in transparent mode.
    If you have ever faced such scenario, would appreciate if you could share your experience.
    Regards
    Vinod

  • Transparent table query

    Hey Folks
    I created a transaparent table.
    and just have one field in it currently.
    Questions:
    1) Every transaprent table needs a primary key? IF yes then is it becos of same concept as Databased? We can join tables using this key?
    2) I created only one entry right now in table and used MANDT as the field : Clicked Key: Clicked initial value :Data element : Z_MAND :
    But when I go to utililites and create a table entry : I see it asks for field name : character
    Although I guess it should ask for MANDT as I created field name as MANDT.
    Can someone help me in these 2 questions.
    Thank You

    1) Every transaprent table needs a primary key? IF yes then is it becos of same concept as Databased? We can join tables using this key?
    Answer yes, to both of your questions. You can create a database view by joining two table, so also you can join them in a select query.
    2) I created only one entry right now in table and used MANDT as the field :
    Clicked Key: Clicked initial value :Data element : Z_MAND :
    But when I go to utililites and create a table entry : I see it asks for field name : character
    Although I guess it should ask for MANDT as I created field name as MANDT.
    It is compulsory to have MANDT as a key field, if you want to make your table records client dependent - all client dependent tables will have MANDT as their first key. The data element for MANDT should be MANDT only. You typically add keys other than MANDT, which define the structure of your table.

  • 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.

  • NullPointerException during UnitOfWork commit

    During UnitOfWork commit the following exception is thrown:
    LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-69] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DescriptorException
    EXCEPTION DESCRIPTION: A NullPointerException was thrown while extracting a value from the instance variable [id] in the object [ClassB].
    INTERNAL EXCEPTION: java.lang.NullPointerException
    MAPPING: oracle.toplink.mappings.DirectToFieldMapping[id-->DatabaseField(B_TABLE.Id)]
    DESCRIPTOR: Descriptor(ClassB --> [DatabaseTable(B_TABLE)])
         at oracle.toplink.exceptions.DescriptorException.nullPointerWhileGettingValueThruInstanceVariableAccessor(Unknown Source)
         at oracle.toplink.internal.descriptors.InstanceVariableAttributeAccessor.getAttributeValueFromObject(Unknown Source)
         at oracle.toplink.mappings.DatabaseMapping.getAttributeValueFromObject(Unknown Source)
         at oracle.toplink.mappings.DirectToFieldMapping.iterate(Unknown Source)
         at oracle.toplink.internal.descriptors.ObjectBuilder.iterate(Unknown Source)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjects(Unknown Source)
         at oracle.toplink.internal.descriptors.DescriptorIterator.startIterationOn(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.discoverUnregisteredNewObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.discoverAllUnregisteredNewObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.assignSequenceNumbers(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.collectAndPrepareObjectsForCommit(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
         at Main.main(Main.java:33)
    INTERNAL EXCEPTION STACK:
    java.lang.NullPointerException
         at oracle.toplink.internal.descriptors.InstanceVariableAttributeAccessor.getAttributeValueFromObject(Unknown Source)
         at oracle.toplink.mappings.DatabaseMapping.getAttributeValueFromObject(Unknown Source)
         at oracle.toplink.mappings.DirectToFieldMapping.iterate(Unknown Source)
         at oracle.toplink.internal.descriptors.ObjectBuilder.iterate(Unknown Source)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjects(Unknown Source)
         at oracle.toplink.internal.descriptors.DescriptorIterator.startIterationOn(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.discoverUnregisteredNewObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.discoverAllUnregisteredNewObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.assignSequenceNumbers(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.collectAndPrepareObjectsForCommit(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
         at Main.main(Main.java:33)
    All attributes of my objects are non-null.
    What's wrong?

    Here are my classes:
    public class ClassA {
    public long id;
    public java.util.List listB;
    public java.lang.String name;
    // Sestters and getters are here
    public class ClassB {
    public long id;
    public java.lang.String name;
    public ClassA refA;
    // Sestters and getters are here
    I use transparent indirection for ClassA.listB and no indirection for ClassB.refA.
    Here is how I use these classes:
    UnitOfWork uow = session.acquireUnitOfWork();
    ClassA objA = new ClassA();
    objA.setName("objectA");
    objA.setListB(new ArrayList(10));
    for (int i = 0; i < 10; i++) {
    ClassB objB = new ClassB();
    objB.setName("objectB" + i);
    objB.setRefA(objA);
    objA.getListB().add(objB);
    uow.registerNewObject(objB);
    uow.registerNewObject(objA);
    uow.commit();
    Here is log:
    2003.07.31 12:48:44.759--DatabaseSession(160388)--Thread[main,5,main]--acquire unit of work:5396218
    2003.07.31 12:48:44.759--UnitOfWork(5396218)--#registerNew(ClassB@4c4975)
    2003.07.31 12:48:44.769--UnitOfWork(5396218)--#registerNew(ClassB@2da3d)
    2003.07.31 12:48:44.769--UnitOfWork(5396218)--#registerNew(ClassB@6c8909)
    2003.07.31 12:48:44.769--UnitOfWork(5396218)--#registerNew(ClassB@497934)
    2003.07.31 12:48:44.779--UnitOfWork(5396218)--#registerNew(ClassB@280a69)
    2003.07.31 12:48:44.779--UnitOfWork(5396218)--#registerNew(ClassB@40ec97)
    2003.07.31 12:48:44.779--UnitOfWork(5396218)--#registerNew(ClassB@3b60c3)
    2003.07.31 12:48:44.779--UnitOfWork(5396218)--#registerNew(ClassB@7a1bb6)
    2003.07.31 12:48:44.779--UnitOfWork(5396218)--#registerNew(ClassB@5e256f)
    2003.07.31 12:48:44.789--UnitOfWork(5396218)--#registerNew(ClassB@6e1fb1)
    2003.07.31 12:48:44.789--UnitOfWork(5396218)--#registerNew(ClassA@1360e2)
    2003.07.31 12:48:44.789--UnitOfWork(5396218)--begin unit of work commit
    2003.07.31 12:48:44.809--DatabaseSession(160388)--Connection(2913640)--begin transaction
    2003.07.31 12:48:44.819--UnitOfWork(5396218)--#executeQuery(DataModifyQuery())
    2003.07.31 12:48:44.819--UnitOfWork(5396218)--Connection(2913640)--UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + 1 WHERE SEQ_NAME = 'CLASSB'
    2003.07.31 12:48:45.430--UnitOfWork(5396218)--#executeQuery(ValueReadQuery())
    2003.07.31 12:48:45.430--UnitOfWork(5396218)--Connection(2913640)--SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = 'CLASSB'
    2003.07.31 12:48:45.660--DatabaseSession(160388)--Connection(2913640)--commit transaction
    2003.07.31 12:48:45.670--UnitOfWork(5396218)--#assignSequence(112->ClassB@5e256f)
    [ Skipped ]
    2003.07.31 12:48:48.515--DatabaseSession(160388)--Connection(2913640)--begin transaction
    2003.07.31 12:48:48.515--UnitOfWork(5396218)--#executeQuery(DataModifyQuery())
    2003.07.31 12:48:48.515--UnitOfWork(5396218)--Connection(2913640)--UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + 1 WHERE SEQ_NAME = 'CLASSB'
    2003.07.31 12:48:48.605--UnitOfWork(5396218)--#executeQuery(ValueReadQuery())
    2003.07.31 12:48:48.605--UnitOfWork(5396218)--Connection(2913640)--SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = 'CLASSB'
    2003.07.31 12:48:48.665--DatabaseSession(160388)--Connection(2913640)--commit transaction
    2003.07.31 12:48:48.685--UnitOfWork(5396218)--#assignSequence(121->ClassB@497934)
    2003.07.31 12:48:48.685--DatabaseSession(160388)--Connection(2913640)--begin transaction
    2003.07.31 12:48:48.685--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:48.695--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO A_TABLE (Id, Name) VALUES (13, 'objectA')
    2003.07.31 12:48:48.765--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@6e1fb1))
    2003.07.31 12:48:48.765--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:48.765--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (120, 'objectB9', 13)
    2003.07.31 12:48:48.855--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@40ec97))
    2003.07.31 12:48:48.855--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:48.855--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (114, 'objectB5', 13)
    2003.07.31 12:48:48.905--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@3b60c3))
    2003.07.31 12:48:48.905--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:48.905--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (117, 'objectB6', 13)
    2003.07.31 12:48:48.965--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@6c8909))
    2003.07.31 12:48:48.965--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:48.965--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (115, 'objectB2', 13)
    2003.07.31 12:48:49.015--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@5e256f))
    2003.07.31 12:48:49.015--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.015--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (112, 'objectB8', 13)
    2003.07.31 12:48:49.086--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@2da3d))
    2003.07.31 12:48:49.086--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.086--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (113, 'objectB1', 13)
    2003.07.31 12:48:49.126--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@4c4975))
    2003.07.31 12:48:49.126--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.126--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (118, 'objectB0', 13)
    2003.07.31 12:48:49.166--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@7a1bb6))
    2003.07.31 12:48:49.176--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.176--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (116, 'objectB7', 13)
    2003.07.31 12:48:49.236--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@497934))
    2003.07.31 12:48:49.236--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.236--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (121, 'objectB3', 13)
    2003.07.31 12:48:49.296--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassB@280a69))
    2003.07.31 12:48:49.296--UnitOfWork(5396218)--#executeQuery(WriteObjectQuery(ClassA@1360e2))
    2003.07.31 12:48:49.296--UnitOfWork(5396218)--Connection(2913640)--INSERT INTO B_TABLE (Id, Name, A_Id) VALUES (119, 'objectB4', 13)
    2003.07.31 12:48:49.326--DatabaseSession(160388)--Connection(2913640)--commit transaction
    2003.07.31 12:48:49.837--UnitOfWork(5396218)--EXCEPTION [TOPLINK-150] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DescriptorException
    EXCEPTION DESCRIPTION: The mapping for the attribute [listB] uses transparent indirection so the attribute [listB] must be initialized to an appropriate container. Currently the value is [null].
    - JDK 1.1.x: an instance of IndirectList, IndirectMap or Hashtable, or one of their subclasses.
    - JDK 1.2 or higher: an instance of an implementor of Collection or Map.
    MAPPING: oracle.toplink.mappings.OneToManyMapping[listB]
    DESCRIPTOR: Descriptor(ClassA --> [DatabaseTable(A_TABLE)])LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-150] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DescriptorException
    EXCEPTION DESCRIPTION: The mapping for the attribute [listB] uses transparent indirection so the attribute [listB] must be initialized to an appropriate container. Currently the value is [null].
    - JDK 1.1.x: an instance of IndirectList, IndirectMap or Hashtable, or one of their subclasses.
    - JDK 1.2 or higher: an instance of an implementor of Collection or Map.
    MAPPING: oracle.toplink.mappings.OneToManyMapping[listB]
    DESCRIPTOR: Descriptor(ClassA --> [DatabaseTable(A_TABLE)])
         at oracle.toplink.exceptions.DescriptorException.indirectContainerInstantiationMismatch(Unknown Source)
         at oracle.toplink.internal.indirection.TransparentIndirectionPolicy.validateAttributeOfInstantiatedObject(Unknown Source)
         at oracle.toplink.mappings.ForeignReferenceMapping.getAttributeValueFromObject(Unknown Source)
         at oracle.toplink.mappings.ForeignReferenceMapping.isAttributeValueInstantiated(Unknown Source)
         at oracle.toplink.mappings.CollectionMapping.mergeChangesIntoObject(Unknown Source)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeChangesIntoObject(Unknown Source)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfWorkingCopyIntoOriginal(Unknown Source)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(Unknown Source)
         at oracle.toplink.mappings.ObjectReferenceMapping.mergeChangesIntoObject(Unknown Source)
         at oracle.toplink.internal.descriptors.ObjectBuilder.mergeChangesIntoObject(Unknown Source)
         at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfWorkingCopyIntoOriginal(Unknown Source)
         at oracle.toplink.internal.sessions.MergeManager.mergeChanges(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.mergeChangesIntoParent(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
         at Main.main(Main.java:46)

  • UnitOfWork / Update / EXCEPTION [TOPLINK-6004]

    Hello!
    I have an ItemObject which contains ItemLines (ValueHolder, Master-Detail).
    I can update the (standard)Item-Objekt attributes, but how can i set the Itemlines-Object? Should i register the Itemlines-ValueHolder in the UnitOfWork? If this is a ValueHolder-Interface, should i read the collection from the database?
    I get the following exception:
    EXCEPTION [TOPLINK-6004] (TopLink - 9.0.3.2 (Build 429)): oracle.toplink.exceptions.QueryException
    EXCEPTION DESCRIPTION: The object [linzag.imds.wdb.bo.model.bean.KnowledgeBranch@50], of class [class linzag.imds.wdb.bo.model.bean.KnowledgeBranch], with identity hashcode (System.identityHashCode()) [80],is not from this UnitOfWork object space, but the parent session's. The object was never registered in this UnitOfWork,but read from the parent session and related to an object registered in the UnitOfWork. Ensure that you are correctly registering your objects. If you are still having problems, you can use the UnitOfWork.validateObjectSpace() method to help debug where the error occurred. For more information, see the manual or FAQ.
    regards
    Harald.

    Harald,
    The simplest solution is to read in and register the ItemObject with a UnitOfWork (TX). Then the traversal of the indirect (ValueHolder) relationship will result in the collection of ItemLine objects automatically being registered.
    At this point you can add, modify, or remove an ItemLine and the UnitOfWork.commit() will capture the change.
    NOTE 1: If you want removal of an ItemLine from the collection to result in its deletion from the database make sure the 1:M relationship is marked as privately owned.
    NOTE 2: For collection relationships such as this you do not need to use a ValueHolder for indirection. TopLink also support transparent indirection of collection relationships.
    Doug

Maybe you are looking for

  • Does anyone know how to download multiple attachments in icloud mail?

    Have tried looking for an answer for this for a long time, but it seems its not possible. Or am I wrong?

  • BFG FX5900 Graphics (Strange Lines)

    I've installed 3 of the same cards on this K72NG-ISLR motherboard, and i get the same result.  Verticle Lines with little dots in them flashing.  This happends at the Main BIOS screen and during the Windowsxp Logo testing startup screen.  After that

  • Layers show hide in Firefox/Netscape

    Uploaded new page to server with layers hide / show for rollovers. Works great in IE the rollovers are excessible. However !! The are not working in Firefox or Netscape. The appear when rolling over but do not stay showing for me to click on the imag

  • Must videos always be imported via Aperture 3?

    I am a complete novice on iMovie so my queries will seem a bit simple. I have a Kodak PlaySport camera, and when I plug it into my MacBook Aperture 3 loads up and the clips are imported to that application. Is this the only way I can import videos? O

  • JQuery/Java Question

    Hi, I'm putting together a site for which I've taken a "pre-packaged" set of scripts to control the nav menu (taken from this site: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm) However, when I run IE8 developer tool and debug, I get th