Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Weblogic - EJB 2.0 CMR Relationship eager loading ??

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using weblogic 6.1 , developing Entity EJBs using CMP. I use Container Managed Relationships to create relationships between Beans using primary key - Foreign key relationship. I have modified my deployment descriptor and everything compiles and deploys fine.

My Scenario is as follow :

I have three tables, table A is related to Table B AND table B is related to table C

I try to access an element form Table A, i can retrieve all related itesm in table B using the relationships. But when i try to access Table C, through the method in table B's local interface, i am not sure what is happening, it just throws a remote exception saying "transaction has timed-out "

I do believe the data is not being loaded for table C, but i am not sure what parameters need to be set in deployment descriptor to make that load in the first place ??

All suggestions are welcome
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ideally, you should be able to navigate to all the related tables provided proper mapping is defined in xml. You have something weird in your descriptor and hence not able to do so. Ejb 2.0 doesn;t restrict you with this. Please specify the relatiionship in the tables and post your mappings.
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By Theory, yes. i agree. i should be able to navigate all along the path.

As i mentioned, i am using weblogic 6.1. I made some research and found that the relationships are not even cached in that version. So, each time i get some values from a relationship table using my local interface, it adds up to a database call.

My deployment descriptor details are as follows.

weblogic-ejb-jar.xml

*********************************

<relationships>
<ejb-relation>
<ejb-relation-name>CCCCC- AAAAA</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>GrieveNatureChecklist has one GrievanceEJB</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>GrieveNatureChecklist</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>AAAAA_grieveSeqId</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>AAAAA may have many CCCCC</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>AAAAA</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>grieveNatureChecklist_grieveSeqId</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>CCCCC - BBBBB</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>CCCCC has one BBBBB</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>CCCCC</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>BBBBB_grieveNatureId</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>BBBBB may have many CCCCC</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>BBBBB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>CCCCC_grieveNatureId</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
</relationships>
*********************************

weblogic-cmp-rdbms-jar.xml

*********************************

<weblogic-rdbms-relation>
<relation-name>CCCCC - AAAAA</relation-name>
<weblogic-relationship-role>
<relationship-role-name>CCCCC has one AAAAA</relationship-role-name>
<column-map>
<foreign-key-column>GRIEVE_SEQ_ID</foreign-key-column>
<key-column>GRIEVE_SEQ_ID</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>

<weblogic-rdbms-relation>
<relation-name>CCCCC - BBBBB</relation-name>
<weblogic-relationship-role>
<relationship-role-name>CCCCC has one BBBBB</relationship-role-name>
<column-map>
<foreign-key-column>GRIEVE_NATURE_ID</foreign-key-column>
<key-column>GRIEVE_NATURE_ID</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>

********************************

help greatly appreciated
:roll:
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try increasing JTA setting for transaction time out
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I increased the time-out to 100 seconds. Still the error repeats and i do not think that it needs 100 seconds to complete this process. I still doubt if weblogic version ( 6.1) I am using does not support this feature.

Any thoughts
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this discussion to BEA/Weblogic forum...
 
Replace the word "snake" with "danger noodle" in all tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic