CMR in EJB2.0

Can anybody please tell me how to develop a container managed entity bean which will retrieve or store data in more than one table in weblogic 6.1.
For eg:
I have a bean named Software which when created needs to insert data in four tables-Software,Software_external,Software_internal and Software_copy_details.
This can be achieved very easily using a single bean in BMP.But is there any way to achieve it using a single bean using CMP? Please mention the details as how to write/include the multiple tables in the deployment descriptors.

I guess you want to do joins using CMP2.0 and want to do activities like add, update delete etc.
When you use CMP2.0 for each table you make an entity bean. You might think that the entity bean is an extension of your database table. Therefore you must use multiple entity beans. The details of join type (direction and one is to many etc) depends on the deployment descriptor and a little also on the code.

Similar Messages

  • EJB2.0 issue on weblogic server 8.1 sp4

    We are doing some ejb2.0 development on weblogic 8.1 sp4, and We have noticed some unusual and undesirable behavior with CMR.
    The following session bean code is used to define a Many-Many relationship between different entity beans in the same EJB using CMR.
    The method does the following:
    1. Gets the existing Collection of parents EJBs for the child EJB.
    2. Checks that the new parent EJB is not in the existing parents Collection
    3. Adds the new parent to the Collection and finally sets the parents Collections for the child EJB.
    public static void addChild(EntityHandle a_parent, EntityHandle a_child)
    throws TrackingException
    TrackedEntityLocal parent = null;
    TrackedEntityLocal child = null;
    parent = getEntity(a_parent);
    child = getEntity(a_child);
    Collection parents = child.getParents();
    if (!containsEJB(parents, parent)) // return true if parent already exists in collection parents.
    parents.add(parent);
    child.setParents(parents);
    In the problem scenario we are creating the child and its parent entities in the same transaction.
    We then define the raltionships by adding parents to the same child EJB on the client side within the same transaction (that created the EJBs) like this:
    addChild( parentOne, child);
    addChild( parentTwo, child);
    addChild( parentThree, child);
    I expect 3 records in the CMR EJB table entity_relationship but I end up with 6 records in table entity_relationship like this.
    parentOne,child
    parentOne,child
    parentTwo,child
    parentOne,child
    parentTwo,child
    parentThree,child
    What seems to be happening is that these EJB relationships are being duplicated in the EJB cache which means that when the container persists the relationships it breaks a unique constraint that is defined in Oracle.
    It seems that each time I call child.getParents() I get a copy of the bean's current parent relationships in the cache (which I then add one new parent to).
    Even though I set the parent Collection back into the bean (which i would expect to replace the existing Collection) at persist time the container seems to attempt to persist 3 distinct Collections.
    We only seem to get this problem if the parent entity itself has not yet been persisted.
    If the parent EJBs have already been created in table entity beforehand, we only get 3 relationships in table entity_relationship.
    parentOne,child
    parentTwo,child
    parentThree,child
    Anybody has any idea what's going on here? thanks a million.
    EJB schema below:
    both parent and child are from one table:entity.
    CREATE TABLE entity
    ( id INTEGER NOT NULL PRIMARY KEY,
    type_id INTEGER NOT NULL
    CONSTRAINT entity_FK
    REFERENCES entity_type(id),
    orig_comp_id INTEGER NOT NULL
    CONSTRAINT entity_FK2
    REFERENCES component(id)
    entity_relationship defines the relation between parent and child
    CREATE TABLE entity_relationship
    ( end1_id INTEGER NOT NULL
    CONSTRAINT entity_relationship_FK
    REFERENCES entity(id),
    end2_id INTEGER NOT NULL
    CONSTRAINT entity_relationship_FK2
    REFERENCES entity(id),
    type_id INTEGER DEFAULT(1)
    NOT NULL
    CONSTRAINT entity_relationship_FK3
    REFERENCES entity_rel_type(id),
    CONSTRAINT entity_relationship_PK PRIMARY KEY(end1_id,end2_id,type_id)
    EJB descriptors given below:
    ============================================ejb-jar.xml===============================================
    <entity>
    <ejb-name>TrackedEntityEJB</ejb-name>
    <local-home>uk.police.pnn.psni.eai.bcomp.tracking.entity.TrackedEntityHomeLocal</local-home>
    <local>uk.police.pnn.psni.eai.bcomp.tracking.entity.TrackedEntityLocal</local>
    <ejb-class>uk.police.pnn.psni.eai.bcomp.tracking.entity.TrackedEntityBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>entity</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <security-identity>
    <use-caller-identity/>
    </security-identity>
    </entity>
    <ejb-relation>
    <ejb-relation-name>entity-entity</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Entity-has-Parents</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>TrackedEntityEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>parents</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Entity-has-Children</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>TrackedEntityEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>children</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    <container-transaction>
    <method>
    <ejb-name>TrackedEntityEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    ==========================weblogic-ejb-jar.xml===================================================
    <weblogic-enterprise-bean>
    <ejb-name>TrackedEntityEJB</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <enable-call-by-reference>true</enable-call-by-reference>
    <local-jndi-name>bcomp.tracking.entity.TrackedEntityHomeLocal</local-jndi-name>
    </weblogic-enterprise-bean>
    =============================weblogic-cmp-rdbms-jar.xml==========================================
    <weblogic-rdbms-relation>
    <relation-name>entity-entity</relation-name>
    <table-name>entity_relationship</table-name>
    <weblogic-relationship-role>
    <relationship-role-name>Entity-has-Parents</relationship-role-name>
    <relationship-role-map>
    <column-map>
    <foreign-key-column>end2_id</foreign-key-column>
    <key-column>id</key-column>
    </column-map>
    </relationship-role-map>
    </weblogic-relationship-role>
    <weblogic-relationship-role>
    <relationship-role-name>Entity-has-Children</relationship-role-name>
    <relationship-role-map>
    <column-map>
    <foreign-key-column>end1_id</foreign-key-column>
    <key-column>id</key-column>
    </column-map>
    </relationship-role-map>
    </weblogic-relationship-role>
    </weblogic-rdbms-relation>
    Edited by: user10185877 on 26-Aug-2008 02:06

    I am also wondering what the status of this problem is? It is preventing us from going to SP4.
    _Mike                                                                                                                                                                                                                                                                                           

  • Application Server Supporting EJB2.0

    Hi
    I am using Websphere4.0 as well as Weblogic 5.1 .
    I want application server which support EJB2.0 spec (especially i want to try out LocalInterface Examples.)
    I want evaluation copy which i can down load.
    I have installed J2EE server 1.3 : For this can anybody tell me about Jars to be set in Class-Path.
    Thanx
    VJ

    You can try Oracle Containers for J2EE (OC4J) at otn.oracle.com/tech/java/oc4j
    this is a J2EE compliant server. But still have an whole implentation about EJB 2.0 (OC4J Developer Preview), However you can try Local interface, CMR, and other features EJB 2.0-specific.
    OC4J is 100% Java implemented. You can launch the OC4J server separately or embebed in the Oracle9iAS (Oracle9i App. Server).

  • CMR between three (transient) connected tables

    Hi,<br><br>
    we have taken over an existing programm using ejb1.1 with bea wl6.1.<br><br>
    Due to performance-reasons we decided to migrate this to ejb2.0 using bea wl8.1. <br>
    However it showed up that wl8.1 with ejb2.0 seems to change the sequence of storing dependend EntityBeans so that we received some ForeignKey-Constraint-Violations.<br>
    Therefor we introduced CMR to enable the container to get control over the relations. We managed to get all the CMRs right except one:<br><br>
    Tables are:<br>
    Table A(<u><b>a</u></b>,<u><b>b</u></b>,c,d) PK a,b<br>
    Table B(<u><b><i>a</u></b></i>,<u><b><i>b</u></b></i>,<u><b>m</u></b>,n) PK a,b,m <br>
    Table A(<u><b><i>a</i></b></u>,<u><b><i>b</i></b></u>,<u><b>x</u></b>,<b><i>m</i></b>) PK a,b,x <br><br>
    Foreign keys are:<br>
    FK B->A using a & b<br>
    FK C->A using a & b, C->B using a, b & m<br>
    (in words: B extends A, C extends A, C may extend B must does not have to)<br><br>
    The FK C->B I do not know how to manage via CMR.<br>
    If I try to set the Reference to B within the ejbPostCreate() using setParent(B) I get this Error:<br>
    [EJB:010146]The setXXX method for a cmr-field that is mapped to a primary key may not be called. The cmr-field is read-only.<br><br>
    If I try not to use the setParent(B) but to set an Reference using setM(m) I get this Error:<br>
    [EJB:010145]When a cmp-field and a cmr-field (relationship) are mapped to the same column, the setXXX method for the cmp-field may not be called. The cmp-field is read-only.<br><br>
    Is there any way to solve this Problem without changing the Database?<br><br>
    And yes I know, you should not use compound Keys in EJB...;-)<br><br>
    Thanks in advance,<br>
    Stephan

    Hi Pooyan,
    thanks for having an look and answering. I agree, using hibernate could help...
    But I was interested in an solution that is will not result in changing the persistance-layer of the whole application (at least not at this moment).
    So far we are getting no errors not using cmr for this particular relation, so we are not forced to solve it.
    But there is no solution (beside changing the persistance to e.g. hibernate) for such an constellation?
    cheers,
    Stephan

  • Finder method to retrieve CMR field?

    Hello all!
    I have two entity EJBs - one named "Property" and another named "Merchandise".
    Property has a one-to-many relationship to Merchandise, and Merchandise is a CMR
    field (named "merchandise") in Property. Now I would like to write a finder method
    for Property to retrieve the CMR field (Merchandise references). The finder method
    is called "findDVD()". The ejb-ql is below:
    SELECT DISTINCT OBJECT(merch) FROM Property AS p, IN(p.merchandise) AS merch
    WHERE merch.starsMasterTitleId = ?1
    AND merch.productTypeCode = 'VIDEO'
    AND merch.format = 'DVD'
    AND merch.active = 'Y'
    AND merch.approved = 'Y'
    AND merch.purchaseable = 'Y'
    However, I can't seem to get this method to work. Weblogic's EJBC keeps complaining
    that the returned collection MUST be of the method owner type - in other words,
    I can't return Merchandise references, only Property references.
    What am I doing wrong? Is this a limitation in CMR that I didn't know about? Please
    help!
    I am using WLS 6.1 with SP 1.
    Thanks so much!
    -B

    If you are using ejb2.0 you can do this using a home method and select
    method instead of a finder. Finders are limited to returning objects of the
    type of ejb they belong to while select methods are not. Select methods
    cannot be invoked directly by the clients so you need a home method to wrap
    them.
    -- Anand
    "Brian Wang" <[email protected]> wrote in message
    news:3ca3678d$[email protected]..
    >
    >
    Hello all!
    I have two entity EJBs - one named "Property" and another named"Merchandise".
    Property has a one-to-many relationship to Merchandise, and Merchandise isa CMR
    field (named "merchandise") in Property. Now I would like to write afinder method
    for Property to retrieve the CMR field (Merchandise references). Thefinder method
    is called "findDVD()". The ejb-ql is below:
    SELECT DISTINCT OBJECT(merch) FROM Property AS p, IN(p.merchandise) ASmerch
    WHERE merch.starsMasterTitleId = ?1
    AND merch.productTypeCode = 'VIDEO'
    AND merch.format = 'DVD'
    AND merch.active = 'Y'
    AND merch.approved = 'Y'
    AND merch.purchaseable = 'Y'
    However, I can't seem to get this method to work. Weblogic's EJBC keepscomplaining
    that the returned collection MUST be of the method owner type - in otherwords,
    I can't return Merchandise references, only Property references.
    What am I doing wrong? Is this a limitation in CMR that I didn't knowabout? Please
    help!
    I am using WLS 6.1 with SP 1.
    Thanks so much!
    -B

  • CMR-and C:\jdev9031

    Hello forum is there a good tutorial how to use CMR in jdev ?
    help please.

    Hi,
    Here is a tutorial on CMR - http://otn.oracle.com/sample_code/tutorials/fbs/cmr/toc.htm
    This tutorial uses the Financial Brokerage Sample application to demonstrate the EJB2.0 features.
    For more tutorials on EJB 2.0 refer to http://otn.oracle.com/sample_code/tutorials/fbs/fbstoc.htm
    Hope this helps.
    Sujatha.
    Tutorials : http://otn.oracle.com/sample_code/tutorials/OTN_Tutorials.html
    Samples : http://otn.oracle.com/sample_code/content.html

  • Oc4j and EJB2.0: not really?

    Hello
    Some colleagues and I are trying to port a large project from JBOSS to OC4J. We used JBOSS 3.0 (beta) in order to evaluate EJB2.0 features and see if we could use it. We already have OC4J in production, but only as a JSP/Servlet container. The next step would be to deploy our EJB application to OC4J.
    We have read the material and it is written that OC4J (developers preview) is EJB 2.0 compliant. However, the specific documentation and the examples don't show how to specify OC4J specifc XML files. We absolutely need CMR and Local Interfaces, because we don't have the time required to downgrade our JBoss EJB2.0 application to the EJB 1.1 specification. We have over 80 Session Beans and over 20 Entity Beans.
    Is there anybody there that can confirm that OC4J developer's preview is really EJB2.0 compliant? If so, could you send me some pointers to information about OC4J container specifc deployment descriptors? The docs listed at the web site don't have EJB2.0 features listed, nor does the Oracle samples.
    Thanks for your attention,
    desperately,
    Luis Fernando Soeiro

    Hello Debu
    I've got alll howtos and I mangaged to get some parts of OC4J [Oracle9iAS (9.0.3.0.0) Containers for J2EE (build 020323.1689)] working.
    There are still some issues that are stalling our development. Could you please comment on them, maybe providing an estimate of when they will be solved/implemented?
    First of all, a little background. Our application uses many Java Swing application clients that connect to the EAR application in the container.
    The ear application has the following structure:
    All database access (Oracle 8i, located in its own server) is done exclusively by means of CMP entity beans. A entity bean may access other entity beans. There are workflow session beans (stateful and stateless) that access the entity beans. All clients see only the workflow session beans (session beans fagade).
    Our applicatoin is complex, having more than 80 session beans and more than 25 entity beans (not counting entity beans that exist only to represent relationships among entity beans).
    There goes the questions:
    1) It seems that entity beans cannot currently be referenced by remote interfaces. We couldn't deploy our application using it. Since we could use only local interfaces fot entity beans, thats what is been done now.
    2) There is no CMR supported. Is this true?
    3) EJBQL seems to be very limited. In the howto examples there are EJBQL statements that compare two numbers. However, when we tried to use String comparisons, it didn't work. Here is the statement:
    "SELECT DISTINCT OBJECT(p) FROM Person p WHERE p.name = ?1"
    If I compile, package and deploy the ear applicatin with the above EJBQL statement, OC4J generates an exception when executing the finder method. The exception is:
    "java.rmi.NoSuchObjectException: Session has timed out
    at com.evermind.server.ejb.StatefulSessionEJBObject.throwPassivisat
    ception(StatefulSessionEJBObject.java:188)
    at Cad023Remote_StatefulSessionBeanWrapper0.obterPessoasPorParteNom
    023Remote_StatefulSessionBeanWrapper0.java:754)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:8
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)"
    If I remove the where clause, the expection is gone. However, I get all records. ;-)
    4) It seems that all EJBQL clauses must be capitalized. Is this true?
    FINALY)
    Is there a newer OC4J build that could use to get the development going? Do you know where there will be one? Is there any way of contacting the OC4J development team to report bugs?
    If you would like, we could discuss it in private e-mail (please use my private mail [email protected]).
    Thanks for your attention,
    Luis Fernando Soeiro
    Hi !! OC4J 9.0.3 developer's preview has most features of EJB 2.0. We are working on updating on our docs and samples for EJB 2.0
    Please look at the following URL that has some How Tos on EJB 2.0 features such Local Interfacea, EJB QL, etc : http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-how-to.html#ejb
    regards
    Debu Panda
    Oracle

  • Challenge of the day - CMR existing tables

    Hey all!
    I have an existing application that contains 1:N table relationships that are already populated with data. How can I convert the EJB's (EJB2.0/CMP2.0) to use CMR?
    As a reference, I have tried this with Jboss 3.2.2 and XDoclet and have only had success with @jboss:auto-key-fields which will make a third table that is blank and only populated when data is added through the EJB relationship, not the existing populated data (that, and why use a third table?).
    Maybe this is the only way, not sure as new to CMR, can anyone be my hero and enlighten me please?

    I guess I'm still a little confused about some parts
    of this. I do already have existing tables (with
    indicies). I do have one big question:
    With CMR, will I be required to create a third table
    for the relationship?
    If not, then it seems that as long as the correct
    mappings (within CMP) have taken place, I should be
    immediately up and running without changes. This is
    the route I initially took with:
    * @jboss.relation
    * related-pk-field="mypk"
    * fk-column="mypk_fk"
    But unfortunately I must have missed something as can
    not get it to work correctly. If someone can help
    point me to one way (a third table) or the other
    (pk/fk mapping within CMP) that will help me on my
    way!Well, here it follows what I'm doing for my People-Address (1:1) relationships and which is working:
         //persistent-relationships
         * @ejb.interface-method
         * view-type="local"
         * @ejb.relation
         * name="People-Address"
         * role-name="1-People-1-Address"
         * multiple="no"
         * target-role-name="1-Address-1-People"
         * target-multiple="no"
         * target-ejb="Address"
         * @jboss.relation
         * fk-constraint="true"
         * related-pk-field="addressId"
         * fk-column="addressId"
         public abstract AddressLocal getHomeAddress();
    AddressLocal is obviously the LocalInterface of the Address entity bean and here we are within the People bean (which is supposed to be the main table). In a relationship, it's important to understand that both the source (People entity in this case) and the target (Address entity in this case) must be set. If there could be more than one Address for one People, than you would have set:
    ...snip
         * @ejb.relation
         * name="People-Address"
         * role-name="1-People-N-Address"
         * multiple="yes"
         * target-role-name="1-Address-1-People"
         * target-multiple="no"
         * target-ejb="Address"
    Hope it will help,
    Marco

  • Cmr filed . urgent help me

    hello
    I want CMR-FIELD to be the part of compound primary key class. How can i do this
    b/c compound primary key class only takes CMP-FIELD. please help, it is very
    much urgent.........
    i am using in j2ee with ejb2.0
    thanx
    sai

    You should just specify the field as cmp-field as usual then add the field in the cmr-field tag in the relationships portion of the deployment descriptor. There should be no problem with identifying relationships where the primary key is also a foreign key to another entity.

  • Ejb 3.0 on OC4J preview 4 CMR is this a BUG

    Exception [TOPLINK-48] (Oracle TopLink - 10g release 3 (10.1.3.0.0) (Build 05091
    2)): oracle.toplink.exceptions.DescriptorException
    Exception Description: Multiple writable mappings exist for the field [ENVINCIDE
    NTS.INCIDENTS_ID]. Only one may be defined as writable, all others must be spec
    ified read-only.
    Mapping: oracle.toplink.mappings.OneToOneMapping[incidents]
    Descriptor: RelationalDescriptor(model.Envincidents --> [DatabaseTable(ENVINCIDE
    NTS)])
    as I understand the CMR uses toplink somewhere under the hood.
    from the docs I got this...
    @OneToMany(cascade=PERSIST)
    @JoinColumn(name="MANAGER_ID", referencedColumnName="EMP_ID")
    public Collection getManagedEmployees() {
    return managedEmployees;
    TopLink defaults and equivalent code
    OneToManyMapping mapping = new OneToManyMapping();
    mapping.setIsReadOnly(false);
    mapping.setIsPrivateOwned(false);
    mapping.setAttributeName(attributeName);
    mapping.setReferenceClass(referenceClass);
    in Toplink mapping there is setIsReadOnly() but how do
    I specify this in ejb 3.0 annotations. I get the above error
    whenever I use any sort of relationship in my ejbs and have the
    same column defined as primary key in the table.

    Take a look at this forum Re: CMR in ejb 3.0
    You basically need to make one of your mappings as read-only and I would recommend doing it with your basic mapping as it is easier to maintain with the set of the @ManyToOne relationship.
    Doug

  • Default Value , Not Null and EJB2.1

    Hi ,
    Am using Weblogic10.3 + Oracle Db + EJB2.1 Local Entity Beans .
    The issue is that one of the table has createdDt which is not null and is defualt is set to Sysdate. When I try to create this Entity with createdDt null , I get an exception like below , But since I have mentioned default value , I shouldnt be getting this. Have I missed something ?
    Code is quite straighforward
    Organisation org = organisationHome.create();
    ....org.setter methods..
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
    ErrorCode=1400 SQLState=23000
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbcspy.SpyPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:159)
         at weblogic.ejb.container.manager.BaseEntityManager.executeInsertStmt(BaseEntityManager.java:763)
         at weblogic.ejb.container.internal.TxManager$TxListener.executeInsert(TxManager.java:900)
         at weblogic.ejb.container.internal.TxManager$TxListener.executeDBOperations(TxManager.java:831)
         at weblogic.ejb.container.internal.TxManager$TxListener.beforeCompletion(TxManager.java:1054)
         at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1217)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1195)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:118)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1302)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2114)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:621)
         at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
         at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl.createOrganisation(DomainServices_7p8lqs_EOImpl.java:7717)
         at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    parmTest( , "param2") is syntactically incorrect, so there can be no "workaround".
    In addition to solutions offered by SwapnilVJ and Saransoft84, you could also use a rest parameter:
    function parmTest(... args)
    // set up default values
    var val1:Boolean=true;
    var val2:String="";
    switch(args.length)
      case 0:break;
      case 1:
       if(args[0] is String){val2=args[0] as String;}
       else{val1=args[0] as Boolean;}
       break;
      case 2:
      default:
       val1=args[0] as Boolean;
       val2=args[1] as String;
       break;
       trace(val1 + " " +val2);
    parmTest();
    parmTest("hello");
    parmTest(null,"hello");
    parmTest("hello",null);

  • EJB Finder View Links and CMR

    Hi,
    Can someone please give me some input on the following warning in the JDeveloper online help!
    "Warning: You cannot create an EJB finder view link that expresses the same relationship as a CMR."
    I'm new to EJB, BC4J and JDeveloper. I created container managed entity beans with local interfaces only to represent my data and relationships. No problems with the mapping so far.
    To test the beans I used Session Facades with remote interfaces and build a sample test client.
    Now I thought I could create EJB Entity Facades, EJB Finder View Objects, EJB Finder View Links and EJB Application Modules to make use of the BC4J framework in order to speed up programming clients (JSP and JClient).
    So I've started studying the JDeveloper online help (which seems to be very useful) and found the above mentioned warning.
    Well, better a warning than nothing at all, but some more explanations would have been even better.
    Is there no need to use view links with CMR?
    How to achieve the same functionality (synchronizing two view objects in a master-detail-relationship) with CMR?
    Do you know any examples? I couldn't find any examples using EJB entity facades in the "sample code" area on OTN.
    Any comments about other (better) architectures are also welcome. Would it be better to use BMP entity beans in conjunction with BC4J?
    Many thanks for your help!
    Regards,
    Eric

    Steven,
    thank you for your reply and suggestions - I'll count on that. If I find time I'll read this book. It seems to be very interesting.
    For educational purposes I'd like to look at both persistence implementation strategies. I agree that it looks definitly easier to use entity objects. Certainly it's also performancewise a better choice.
    Anyhow, could you give me some useful tips for cmp entity beans and finder view objects?
    Is there something which works completely different if I use BC4J on top of it?
    How to implement a master-detail relationship in JClient (Swing) for example?
    What about writing an ejbfinder which doesn't return all, but all data where the foreign key is equal to a parameter passed to the finder method and use this as the source for a detail view object. This could be the primary key of the selected master. Well, I don't know whether this is doable. But that's what comes to my mind spontaneously.
    Would this be a solution? I'm still thinking about the aforementioned warning in the online help regarding view links.
    I guess the problem is that the foreign key is not part of the entity bean as it's not a cmp-field. Instead you have accessor methods to retrieve a related object or a collection of objects.
    I'm sure my questions are not too complicated to answer. It's only hard for a beginner to get an overview.
    I'm quite confident that I'll manage this if I give my best and get some help from knowledgeable people like you Steven.
    Regards,
    Eric

  • CMR and Transaction Attribute

    I got two ReadOnly CMP entity beans with a 1:N relationship, and one session facade,
    all with the TX attribute of NotSupported. When I tried to get the CMR collection
    in the session bean, WebLogic 6.1 SP3 threw an EJBException saying the CMR collection
    could not be accessed outside a TX context. Only by changing the TX attribute
    of the SLSB to Required (left the CMP bean TX attribute unchanged) could I get
    the collection. What is the reason behind this behavior? I want the caching
    feature of the ReadOnly beans but do not want ot pay any price for transactions.
    Is this possible?

    I do one more test and found
    UPDATE exception raised when I have foreign key in table. If I use only plain fild evething is ok. If add to entity foreign key field container raise exception when it try to update record.

  • CMR Problem: Can you create CMR beans in different packages?

    I created a Related Entity bean (ClassA) and unchecked the boxes that indicated it would create the other entity beans that were linked to the table.
    I then created new Entity beans (ClassB and ClassC) in separate packages. I then set up the relationships in the ClassA Related module. Did the mappings, etc.
    When I compile the application I get an error message indicating that the accessor methods (which the IDE auto-generates!) to what I have set as CMR fields can only be for CMP or CMR fields!
    I've tried the PartsSupplier2CMR example and deployed it, but it is a flat tree.
    Has anyone else come across something like this??
    Thanks

    I copied and pasted your code as well as made c08 and c09 directories. I had no errors compiling. I am using NT, but it appears that your problem is Classpath related. You can try to CD to the C:\Java directory and compile using "javac c09\Test.java" That's the command I used.

  • Many-to-Many CMR

    hi all,
    i defined two entity beans, Quiz and Question, with many-to-many cmr and
    a table named Quiz_questions_Question_quizesTable is created in the database after deployment process. the formed table columns consist of primary key of Quiz and primary key of Question, as expected. what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz. is it possible? and how? or what should i do?
    thanks in advance..

    "what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz."
    Makes sense, but then the association table is no longer just an association table.
    Perhaps a way to get you in the right frame of mind is, "how would you model this with just objects?"
    Basically a CMR just represents an association between two objects. You would see in your revised object model that you do not have a simple n-to-n association between a Quiz objects and a Question objects.[Quiz](0..n)---->(1..n)[Question]The above (bastardized UML) model does not represent the enumeration of Question objects within the scope of a single Quiz object.
    Perhaps the following is more accurate:[Quiz](1)---->(1..n)[QuizQuestion](0..n)---->(1)[Question]or                     [Question]
                              A
                              |
                              |
    [Quiz](1)---->(1..n)[QuizQuestion]It is only after you have your object model that you should worry about the entity bean stuff.

Maybe you are looking for

  • It is possible to have two tables of same name in Oracle !

    Oracle Version:10gR2 In MS-Access 2007, I had to use the 'Export' feature by which i copy a table (and its data) to an Oracle Schema via ODBC connection. Later i realised that , when copying tables with a mix of lower and upper case names , the table

  • Important licensing question for Adobe CS6 Production Premium (Student-Licensing)

    Hello dear Community! I have a very small film production and live in a flat share with students as my roommates. One of my associates is a good friend of mine and is also very interested in movie- and film-editing. He also asked me what softwares ar

  • Posting Period cut off

    Hi SAP Gurus, We have this situation, we are a manufacturing plant. Production is under shifting mode. We have two shifts A and C shift. A is 7AM-&7PM and C is 7PM-7AM. Our Accounting and sales group (GL posting) want this cut off aligned to producti

  • Buying LR4 full version ?

    Hi - I have an old MAC which is not compatible with LR5 (OS10.6.8), I have downloaded the LR4 trial version and want to buy the full version (serial number). However, Adobe only seem to offer LR5 via their website. Anyone help ? Thanks

  • FM:MCEX_BW_LO_API

    Hi Gurus This FM is used with following business content data source. 2LIS_03_BX 2LIS_03_BF 2LIS_03_UM I am adding few new objects to all this 3 data source so would you pl tell me if I need to write code to this FM for all the 3 data source? or do I