Oracle Dabase Schema with OC4J CMP Entity EJB

I have tables in a schema called vsxlib. My Entity EJBs that map to SQL SERVER tables (no schema) work perfectly. My Entity CMP EJBs that connect need to connect to the vsxlib schema only partially work.
The findAll method works. When I add a where clause, I get no results back.
When I try a findByPrimaryKey, I get a ObjectNotFoundException.
Does OC4J version 9.0.3 support database schemas? There were examples posted at http://otn.oracle.com/sample_code/tech/java/j2ee/javacookbook/transactionsample/readme.html#descfiles say that they have an Entity bean working within a db schema.
Could it be permission related????
I even tried creating a synonym pointing to the table within the vsxlib schema.. No Luck.
I had this same problem with JBoss3.2 and found out that they did not support db schemas. That is why I was wanting to switch to OC4J because I thought for sure, being an oracle product that it would support db schemas.
Any help is greatly appreciated.

Hi Alex,
I think you may be misunderstanding the meaning of 'database schemas'. For your information, in the Oracle database, a schema is the same as a database user. For example all the database tables belonging to user SCOTT (TIGER) are said to be in the SCOTT schema.
OC4J uses the term 'database schema' differently. Here it refers to the mapping of database datatypes to java classes. Look at the "j2ee/home/config/database-schemas" subdirectoryof the OC4J installation for more details. The "data-sources.xml" file has a 'schema' tag (not sure if that's the correct name) which points OC4J to the datatype mapping XML file -- usually one of those that come with the distribution. However, I use OC4J stand-alone version and I don't need to worry about the mappings at all -- OC4J already knows the mappings for an Oracle database (I assume).
In order to access a particular Oracle schema, I merely have to log in to the database as the appropriate user. So, using the previous example, if I configure the "data-sources.xml" file to use 'scott' as the database login, then OC4J can access the SCOTT schema. You can find more details about Oracle's use of the term 'schema' in the Oracle documentation, which is available from:
http://tahiti.oracle.com
Hope this has answered your question.
Good Luck,
Avi.

Similar Messages

  • Oracle sequence problem in CMP Entity EJB

    I have a problem with Oracle sequence when I am using from the CMP entity EJB in WebLogic
    6.1:
    The problem is when the WebLogic server starts it acquires the correct sequence number
    from Oracle, but during the runtime, when I open a new sqlplus window and increment
    the sequence number, the container is not picking up from the new incremented value
    instead it is still continuining by incrementing the old sequence number it has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xml are exactly
    same
    Any help would be greatly appreciated.

    Change the key-cache-size to 1 in weblogic-cmp-rdbms-jar.xml and then try
    your experiment again.
    -- Anand
    "Satya" <[email protected]> wrote in message
    news:3d06274c$[email protected]..
    >
    I have a problem with Oracle sequence when I am using from the CMP entityEJB in WebLogic
    6.1:
    The problem is when the WebLogic server starts it acquires the correctsequence number
    from Oracle, but during the runtime, when I open a new sqlplus window andincrement
    the sequence number, the container is not picking up from the newincremented value
    instead it is still continuining by incrementing the old sequence numberit has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xmlare exactly
    same
    Any help would be greatly appreciated.

  • Deploying CMP Entity EJB: NullPointerException

    Hi,
    I have built a very simple CMP Entity EJB, when deploying it to Oracle8i 8.1.7, it fails and return this error:
    Processing container managed persistence bean...java.lang.NullPointerException
    java.lang.Class java.lang.Class.forName0(java.lang.String, boolean, java.lang.ClassLoader)
    java.lang.Class java.lang.Class.forName(java.lang.String)
    void oracle.aurora.ejb.deployment.GenerateEjb.cmpDeploy(oracle.aurora.ejb.dd.OracleEntityDescriptor)
    void oracle.aurora.ejb.deployment.GenerateEjb.invoke()
    void oracle.aurora.server.tools.sess_iiop.ToolImpl.invoke(java.lang.String[], java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
    void oracle.aurora.ejb.deployment.GenerateEjb.main(java.lang.String[])
    Can anyone help????
    Patrick.
    null

    I have the same problem with JDeveloper 3.2.3 and 8.1.7.2
    Here is the error:
    *** Executing deployment profile E:\Xaris\JDeveloper\General\EJBs\EmpCmp\EmpCmp.prf ***
    *** Generating archive file E:\Xaris\JDeveloper\General\EJBs\EmpCmp\empcmp.jar ***
    Compiling the project...done
    Validating the profile...done
    Initializing deployment...done
    Scanning project files...done
    Generating classpath dependencies...done
    Generating archive entries table...done
    *** Archive generation completed ***
    *** Deploying the EJB to 8i JVM ***
    EJB deployment argument list:
    "E:\Program Files\Oracle\JDeveloper 3.2.3\java1.2\jre\bin\javaw"
    "-DPATH=E:\Program Files\Oracle\JDeveloper 3.2.3\bin;E:\Program Files\Oracle\JDeveloper 3.2.3\java1.2\bin"
    -classpath
    "E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\aurora_client.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\lib\javax-ssl-1_2.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\jasper.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\vbjorb.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\vbjapp.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\vbjtools.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\vbj30ssl.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\aurora.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\sqlj\lib\translator.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\sqlj\lib\runtime.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\aurora\lib\mts.jar;E:\Xaris\JDeveloper\General\EJBs\EmpCmp\classes;E:\Program Files\Oracle\JDeveloper 3.2.3\lib\jdev-rt.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\jdbc\lib\oracle8.1.7\classes12.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\lib\connectionmanager.zip;E:\Program Files\Oracle\JDeveloper 3.2.3\lib\javax_ejb.zip;C:\Program Fil
    s\JavaSoft\JRE\1.3.1\lib\i18n.jar;C:\Program Files\JavaSoft\JRE\1.3.1\lib\jaws.jar;C:\Program Files\JavaSoft\JRE\1.3.1\lib\rt.jar;C:\Program Files\JavaSoft\JRE\1.3.1\lib\sunrsasign.jar;E:\Program Files\Oracle\JDeveloper 3.2.3\lib\xmlparserv2.jar"
    oracle.aurora.ejb.deployment.GenerateEjb
    -u
    harris
    -p
    harris
    -s
    sess_iiop://192.168.10.218:2481:WORK
    -republish
    -keep
    -temp
    TEMP
    -descriptor
    "E:\Xaris\JDeveloper\General\EJBs\EmpCmp\EmpCmp.xml"
    -oracledescriptor
    E:\Xaris\JDeveloper\General\EJBs\EmpCmp\EmpCmp_oracle.xml
    -generated
    "E:\Xaris\JDeveloper\General\EJBs\EmpCmp\EmpCmpClient.jar"
    "E:\Xaris\JDeveloper\General\EJBs\EmpCmp\empcmp.jar"
    Reading Deployment Descriptor...done
    Verifying Deployment Descriptor...done
    Gathering users...done
    Processing container managed persistence bean...java.lang.NullPointerException
         java.lang.Class java.lang.Class.forName0(java.lang.String, boolean, java.lang.ClassLoader)
         java.lang.Class java.lang.Class.forName(java.lang.String)
         void oracle.aurora.ejb.deployment.GenerateEjb.cmpDeploy(oracle.aurora.ejb.dd.OracleEntityDescriptor)
         void oracle.aurora.ejb.deployment.GenerateEjb.invoke()
         void oracle.aurora.server.tools.sess_iiop.ToolImpl.invoke(java.lang.String[], java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
         void oracle.aurora.ejb.deployment.GenerateEjb.main(java.lang.String[])
    null
    *** Errors occurred while deploying the EJB to 8i JVM ***
    *** Deployment completed ***
    Does anyone know what is the problem?

  • Error while using sybase trigger with the CMP entity bean,ejb version 2.1

    Hi All,
    I am using ejb version 2.1 and using entity bean (Transaction required) ,i am trying to update data in sybase(ver 12.3) database table
    I am using session bean(Transaction required) to update the multiple entity beans in a while loop.It is working fine .But when i am trying to run it with the trigger which updates multiple tables in different sybase databases on update of each entity.Then it throws NoSuchEntityException and it rollback the whole transaction.
    My trigger has only few simple update statements and the trigger runs fine without my CMP entity bean.is the CMP does not support the update triggers in sybase or is it the problem with the transaction.
    Please help
    Thanks
    Anshu

    If you can have a look at a cmp example in the samples that ship with the server. My guess is that the weblogic-ejb-jar.xml file is missing the <persistence-use> element which for 810 would look like:
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    I seem to recall that the elements might be slightly different in structure for the wls700 version of the DTD, so please check that (I cannot, I'm at home and don't have everything here).
    Give that a try and see if it doesn't solve your compilation failure.
    Also, the compilation should not be throwing a null pointer exception in a case like that, I consider that to be a bug.
    -thorick

  • Error when deploying an CMP-Entity EJB

    Hi ,
    I am unable to deploy a simple example of CMP ,when i select Entity,then select Deployment Settings->Generate Default SQL,
    My SQL Query is:'SELECT OBJECT(p) FROM Product p' for FfindAllProducts().
    I get the error message:
    ERROR:while generating SQL.
    The SELECT clause has a return type that does not match the return type
    of the select query for which it is defined
    EJB QL statement: 'SELECT OBJECT(p)fROM Product p'
    EJB QL method:public abstract java.util.Collection com.aa.ProductHome.findAllProducts() throws javax.ejb.FinderException,java.rmi.RemoteException.
    Followinng are the codes of My bean
    ProductHome.java
    import javax.ejb.*;
    import java.rmi.RemoteException;
    import java.util.Collection;
    public interface ProductHome extends EJBHome
    Product create(String productId,String name , String description , double basePrice) throws CreateException,RemoteException;
    public Product findByPrimaryKey(ProductPK key) throws FinderException,RemoteException;
    public Collection findByName(String name) throws FinderException,RemoteException;
    public Collection findByDescription(String description) throws FinderException,RemoteException;
    public Collection findAllProducts() throws FinderException,RemoteException;
    ProductBean.java
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public class ProductBean implements EntityBean
    protected EntityContext ctx;
    public String productid;
    public String name;
    public String description;
    public ProductBean()
    public String getName() throws RemoteException
    return this.name;
    public void setName(String name) throws RemoteException
    this.name=name;
    public String getDescription() throws RemoteException
    return this.description;
    public void setDescription(String description) throws RemoteException
    this.description=description;
    public String getProductId() throws RemoteException
    return this.productid;
    public void setProductId(String ProductId) throws RemoteException
    this.productid=ProductId;
    public void ejbActivate()
    public void ejbPassivate()
    public void ejbRemove()
    public void ejbLoad()
    public void ejbStore()
    public void setEntityContext(EntityContext ctx)
    this.ctx = ctx;
    public void unsetEntityContext()
    this.ctx = null;
    public void ejbPostCreate(String productId,String name,String description,double baseprice)
    public ProductPK ejbCreate(String productId,String name,String description,double baseprice) throws CreateException,RemoteException
    called ");
    setName(name);
    setProductId(productId);
    setDescription(description);
    return null;
    Product.java
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public interface Product extends EJBObject
    public String getName() throws RemoteException;
    public void setName(String name) throws RemoteException;
    public String getDescription() throws RemoteException;
    public void setDescription(String description) throws RemoteException;
    public String getProductId() throws RemoteException;
    public void setProductId(String productid) throws RemoteException;
    ProductClient.java
    import java.rmi.*;
    import javax.rmi.*;
    import javax.naming.*;
    import javax.ejb.*;
    import java.util.*;
    public class ProductClient
    public static void main(String ars[])
    ProductHome home=null;
    try
    Context initial = new InitialContext();
    Context myEnv = (Context)initial.lookup("java:comp/env");
    Object objref = myEnv.lookup("ejb/TheProduct");
    home = (ProductHome)PortableRemoteObject.narrow(objref,ProductHome.class);
    home.create("123-446-7890","p5-350","350 Mhz Pentium",200 );
    home.create("123-446-7891","p5-400","400 Mhz Pentium",300 );
    home.create("123-446-7892","p5-450","450 Mhz Pentium",400 );
    home.create("123-446-7893","p5-500","500 Mhz Pentium",500 );
    home.create("123-446-7894","p5-550","550 Mhz Pentium",600 );
    Iterator i = home.findByName("p5-400").iterator();
    System.out.println(" Product Match the name of p5-400 " );
    if ( i.hasNext() )
    Product prod = (Product)PortableRemoteObject.narrow(i.next(),Product.class);
    System.out.println(prod.getDescription());
    else
    throw new Exception(" Could not find Product ");
    catch(Exception e)
    System.out.println("Caught Exception " );
    e.printStackTrace();
    finally
    if ( home != null)
    System.out.println(" Destroying all products " );
    try
    Iterator i = home.findAllProducts().iterator();
    while ( i.hasNext() )
    Product prod = (Product)PortableRemoteObject.narrow(i.next(),Product.class);
    if (prod.getProductId().startsWith("123"))
    prod.remove();
    catch (Exception e)
    e.printStackTrace();
    ProductPk.java
    import java.io.Serializable;
    public class ProductPK implements java.io.Serializable
    public String ProductId ;
    public ProductPK(String id)
    this.ProductId = id;
    public ProductPK()
    public String toString()
    return ProductId;
    public int hashCode()
    return ProductId.hashCode();
    public boolean equals(Object Product)
    return ((ProductPK)Product).ProductId.equals(ProductId);

    can u pls tell me u are using ejb1.1 specifications or ejb2.0 specifications.in both cases pls shoe u are descripters so that i can check.

  • Oracle 10gXE: Schema with Apex

    Hello,
    I have following Software in use:
    Windows2000 Professional,
    Oracle 10g XE,
    Apex 2.xxx
    My Problem:
    I have an user with the name "admin".
    This user has created all objects (table,trigger, ...) with apex.
    So all the created object by the user "admin" will belong to the schema "admin".
    I use the import function from apex to import data in tables. Now i want create an other user to import data to the tables, but apex don´t display the tables. Because the tables belong to the schema from "admin".
    When I use Import-Function, i can choose an schema. But it is only one schema available (from the loged on user). How can I get Access to the Schema from the user "admin" when I want Import Data? I have set privileges, but the Frontend Apex don´t show affect and I can only choose my own schema, but not that schema from the user "admin".
    I hope you can help me.
    Thanks.

    There is a separate OTN group devoted to XE. You should ask your question there.

  • Database Views with Entity EJBs

    Is it possible to use Weblogic Workshop to create a CMP entity EJB on an Oracle database view for a Weblogic 8.1 server?
    Is there special configuration I need to do for either the Oracle or Weblogic side to accomplish this?
    Thanks.
    Tania

    I can manually create the EJB, an it builds just
    fine, but when I go to deploy it, I get the following
    error:
    [EJB:011076]Unable to deploy the EJB
    'AssortmentMerchandise' because the databas
    e table 'K_BA01.BAV_ASRT_CLUSTR_DAT' is not
    accessible. Please ensure that this
    table exists and is accessible.
    The view is on the same datasource that I have
    successfully created all of my other entity EJBs
    (from tables).
    I can select data from the view using JDBC and the
    same datasource that I am trying to associate the EJB
    to.
    Any ideas what might be wrong with my view?Are you using synonyms or aliases? I would double check those...
    Log in using same username and password as weblogic and try a simple query:
    select * from K_BA01.BAV_ASRT_CLUSTR_DAT

  • Entity EJBs

    Hello!!
    My application works with tables in a Oracle database but I have several Entity EJB too .. is it absolutely necessary to create the tables that are used by the Entity EJBs in a data dictionary project?
    I hope anybody help me.
    Thanks

    Hi,
    no, using Data Dictionary is necessary only if you want to use OpenSQL to access the database. In your case you can use EJBs with Vendor of Native SQL DB access. For more info on the persistency layers that are available on the Web AS Java, see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm">this page</a>.

  • Caching CMP entity beans in a Weblogic cluster

    We are currently looking for pilot customers for our clustered transactional
              CMP Entity EJB cache. It works with the Weblogic's transaction management
              and CMP implementation to coherently and transactionally cache CMP Entity
              EJBs in a cluster, providing close to zero-latency access to CMP data --
              even for read/write beans.
              Problem Description:
              Performance of J2EE applications using CMP Entity EJBs degrades when running
              in a cluster due to the disabling of Entity EJB caching (i.e. the
              requirement to set db-is-shared=true).
              Requirements:
              1. You are running Weblogic in a cluster
              2. Your application has at least one Weblogic CMP Entity EJB
              3. The data related to your Weblogic CMP Entity EJB is only being updated by
              Weblogic CMP Entity EJBs (i.e. you could set db-is-shared=false if you were
              not clustering)
              Solution Description:
              1. No source code or deployment descriptor changes
              2. One additional automated build step (ANT-compatible)
              3. Configurable cache (e.g. size-limited)
              We plan to begin introduce the product to pilot customers on 28 January
              2002, so if you are interested, please drop me an email at
              [email protected]
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              Clustering Weblogic? You're either using Coherence, or you should be!
              Download a Tangosol Coherence eval today at http://www.tangosol.com/
              

    Could somebody please guide me on this?
    Dipak Jha

  • Creating Entity EJB's in loop

    I have a servlet in my EAR that inserts default fields into a table based on one of my CMP Entity EJB's (v2.x).
    The servlet operates as such:
    public void init(ServletConfig config) throws ServletException {
         super.init(config);
         ServletContext application = getServletContext();
         Context ctx = null;
         AccountType act = null;
         AccountTypeHome acth = null;
         try{
              ctx = new InitialContext();
              Object obj = ctx.lookup(JNDI_USERPRIVELAGES);
              application.log("Creating system privelage groups...");
              UserPrivelages usp = null;
              UserPrivelagesHome usph = null;
              usph = (UserPrivelagesHome) PortableRemoteObject.narrow(obj,UserPrivelagesHome.class);
              usp = usph.create(new Integer(1),baseUserPrivelages[0][0],baseUserPrivelages[0][1],baseUserPrivelages[0][2]);
              UserPrivelages uspStandard = usph.create(new Integer(2),
                   baseUserPrivelages[0][0],baseUserPrivelages[0][1],
                                  baseUserPrivelages[0][2]);
              application.log("Created system privelage groups...");
              application.log("Creating system users...");
              Context ctx2 = new InitialContext();
              SysUserHome sysh = null;
              application.log("Looking up: "+JNDI_SYSUSER);
              Object o = ctx2.lookup(JNDI_SYSUSER);
              application.log("Narrowing object...");
              sysh = (SysUserHome) PortableRemoteObject.narrow(o,SysUserHome.class);
              for(int i=0;i<1;i++){
                   String[] users = baseSysUsers;
                   application.log("Creating: "+users[1]);
                   Integer id =new Integer(users[0]);
                   String login = users[1];
                   String pword = users[2];
                   String forename = users[3];
                   String surname = users[4];
                   String empNo = users[5];
                   String priv = users[6];
                   String group = users[7];
                   String lastUpdatedBy = users[8];
                   SysUser sys = null;
                   application.log("Creating sysuser...");
                   sys = sysh.create(id,login,pword,forename,surname,empNo,priv,group,new java.sql.Timestamp(System.currentTimeMillis()),lastUpdatedBy);
                   application.log("Created "+users[1]);
              application.log("Created system users...");
         } catch(NamingException ne){
              application.log("Error initialising startup!",ne);
         } catch(RemoteException re){
              application.log("Error creating startup db entries.",re);
         } catch(CreateException ce){
              application.log("Error creating Sysuser",ce);
    When the servlet starts, the first 2 ejbs are created without a problem. When it gets to the loop to create the SysUsers, it seems to create the first then throws the following exception:
    Error creating startup db entries.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException; nested exception is:
         javax.transaction.RollbackException
    java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException; nested exception is:
         javax.transaction.RollbackException
    javax.transaction.RollbackException
         <<no stack trace available>>The ejbCreate method for the SysUserBean interface is as follows:
         public Integer ejbCreate(Integer id,
         String login,
         String pword,
         String forename,
         String surname,
         String empNo,
         String privelage,
         String group,
         java.sql.Timestamp lastUpdated, String lastUpdatedBy) throws CreateException {
              System.out.println("Constructing new SystemUser with login: "+login);
              this.setSysu_id(id);
              this.setSysu_login_name(login);
              this.setSysu_password(pword);
              this.setSysu_forename(forename);
              this.setSysu_surname(surname);
              this.setSysu_forename(empNo);
              this.setSysu_user_privelage(privelage);
              this.setSysu_user_privelage(group);
              this.setSysu_last_updated(lastUpdated);
              this.setSysu_last_updated_by(lastUpdatedBy);
              System.out.println("Created new SystemUser: "+login);
              return null;
         }When I run the code, the servlet runs up until it calls sysh.create(...) where it throws the exception.
    Inside the ejbCreateMethod, the whole method is run (as I have the "System.out.println('Created new SystemUser: '+login);" statement having been executed.
    The "return null" statement at the end of the method doesn't seem to be the problem (it is a CMP) besides, I've tested it with returning the primary key (return this.getSysu_id()) but this makes no difference and I have the same implementation for the UserPrivelages interface.
    The ejbCreate method in the UserPrivelagesBean class also has the same format without the error occurring.
    I'm currently testing with the J2EE Application deployment tool 1.3.
    Do I need to "close" (if such an option exists) the SysUser interface before I create a new one?
    Cheers,
    Anthony

    Found the problem. Too much late night programming. I double declared a couple of methods in the Create method on the SysUserBean class.
    All working fine now.
    Anthony

  • What is the usual way of accessing Oracle by JSF with connection pooling?

    I am writing to access Oracle by JSF with connection pooling.
    EJB is too difficult for me.
    What is the simple way of doing it?
    thanks

    Leung,
    I believe there should be some sample code available via the JavaServer Pages Samples Web page.
    Good Luck,
    Avi.

  • Sample Oracle database Schema and sample training SQL

    Hi,
    I am running a windows 7, 64 bit machine. I am looking for sample oracle database schema with sample SQL queries and exercises(tutorial). Can you please point me in the right direction where I can download both.
    Thanks for your time and help.

    sb92075 wrote:
    ssk1974 wrote:
    Hi,
    I am running a windows 7, 64 bit machine. I am looking for sample oracle database schema with sample SQL queries and exercises(tutorial). Can you please point me in the right direction where I can download both.
    Thanks for your time and help.
    http://www.lmgtfy.com/?q=oracle+sample+schema
    LOL!!!!

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • What are the necessary elements in ejb-jar.xml with CMP entity bean

    What are the necessary elements in ejb-jar.xml with CMP entity bean
    Actually i am using webligic 8.1 and while deployment getting the error that
    some elements r missing
    Thanks
    Anand Pritam

    According to the ejb-jar.xml dtd ejb-name, ejb-class, persistence-type, prim-key-class, reentrant are the required elements for an entity bean.
    <!ELEMENT entity (description?, display-name?, small-icon?,
              large-icon?, ejb-name, home?, remote?, local-home?,
              local?, ejb-class, persistence-type, prim-key-class,
              reentrant, cmp-version?, abstract-schema-name?,
              cmp-field*, primkey-field?, env-entry*, ejb-ref*,
              ejb-local-ref*, security-role-ref*, security-identity?,
              resource-ref*, resource-env-ref*, query*)>

  • ORA-01407 when removing a CMP Entity Bean with WLS 9.1

    Hi all !
    I hope you can help me to solve this ?:|
    I'm migrating my application from WLS 8.1 SP3 to WLS 9.1.
    I'm getting now an SQLException when I try to remove a CMP Entity Bean.
    The stacktrace is as follows:
    java.sql.SQLException: ORA-01407: cannot update ("USER"."MY_TABLE"."THE_CMR_FIELD") to NULL
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1120)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1278)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3415)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3498)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:128)
    Of course, I replaced the table and column names above to be more readable ;-)
    The table MY_TABLE has a CMR field called THE_CMR_FIELD. The column is not nullable in the database (by the way, it's an Oracle 9i).
    Everything is fine under WLS8.1
    I tried two different Oracle JDBC drivers (9.2.0.5 and 10.2.0.1.0), but the result is always the same within WLS9.1.
    Any ideas or suggestions (or even questions) are more than welcome!
    Thanks
    Eric

    What's even more weird is that I have what seams to be the same problem on Weblogic 6.1 (SP4).
    Here's the stacktrace:
    <pre>
    javax.ejb.EJBException:
    Start server side stack trace:
    java.sql.SQLException: ORA-01407: cannot update ("SCHEMA"."TIM_WP_DAY_CORE_PERIODS"."TWD_ID") to NULL
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
         at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:503)
         at package.WorkPatternDayCorePeriods_vd9y46__WebLogic_CMP_RDBMS.__WL_store(WorkPatternDayCorePeriods_vd9y46__WebLogic_CMP_RDBMS.java:2317)
         at weblogic.ejb20.manager.DBManager.flushModified(DBManager.java:438)
         at weblogic.ejb20.internal.TxManager$TxListener.flushModifiedKeys(TxManager.java:552)
         at weblogic.ejb20.internal.TxManager.flushModifiedBeans(TxManager.java:298)
         at weblogic.ejb20.manager.BaseEntityManager.flushModifiedBeans(BaseEntityManager.java:1246)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.flushModifiedBeans(RDBMSPersistenceManager.java:1106)
         at weblogic.ejb20.manager.BaseEntityManager.cascadeDeleteRemove(BaseEntityManager.java:840)
         at weblogic.ejb20.manager.DBManager.remove(DBManager.java:656)
         at weblogic.ejb20.internal.EntityEJBLocalObject.remove(EntityEJBLocalObject.java:97)
         at package.WorkPatternDayCorePeriodsEJB_vd9y46_ELOImpl.remove(WorkPatternDayCorePeriodsEJB_vd9y46_ELOImpl.java:722)
         at package.PersonWorkPatternBC.removeWorkPatternDay(PersonWorkPatternBC.java:571)
         at package.remove(PersonWorkPatternBC.java:708)
         at package.TimPersonCalendarServiceEJB.removeWorkPattern(TimPersonCalendarServiceEJB.java:140)
    </pre>
    In fact I have this setup:
    <pre>
    workpattern 1..n workpatternday -| 1..n dayperiod
    | 1..n daycoreperiod
    </pre>
    And before 'ejbRemove'ing the workpattern I first remove the days and before that the periods and core periods.
    I start with the periods and instead of removing them in the DB he tries to update the FK to the day with '' (p6spy result).
    When I remove the not null constraint on the foreign key everything passes to the day where the workpatternId cannot be set to null.
    He does not throw errors on the coreperiod (where the not null constraint to day is still present).
    When I invert the sequence of deleting
    (first the core periods then the 'regular' periods) he complains about the dayId on the core periods table.
    So it's completely absurd :S
    I hope weblogic 8.1 might solve this problem as this development code is still to be migrated to 8.1 before going in production...
    I would just like to know what's wrong. There are other places with just about the same relationships (CMR and DB) where he does not complain...

Maybe you are looking for

  • DTS Import of MDB in SQL Server 2000 Drops Memo Field Data

    I have used DTS in SQL Server 2000 to import an MDB filed (MS ACCESS) of a table.  When the table is imported the primary key is lost and the memo field data is completely gone.  I use the tranformation option in the DTS wizard to add the primary key

  • Warp Stabilizer crops bottom of video if videos layers are beneath it for no reason.  Why???

    Warp Stabilizer crops bottom of video if videos layers are beneath it for no reason.  Why??? remove the layers beneath and it's fine.  Hopefully adobe addresses this issue asap to save all of us a good amount of time.

  • Tieing material reservation with purchase order

    Hi,      At my client site they make manual reservations to create demand and thus trigger purchase orders to replenish it. Once the PO is GRed then the manual reservations are manually deleted. This is extra work for the planners/buyers. Is there an

  • HTML form over Flash bkd in Safari

    Hi, I've got a site which uses an animated Flash background element which is overlayed with a div containing an HTML form. It works fine in every browser I have, except Safari. In Safari, as soon as I click in the form, the entire HTML content of the

  • Satellite L300-0H9 - DC jack needs to be replaced

    My DC jack needs to be replaced and I'm not able to find a new one. I looked at ebay and some other websites, but they dont have a DC jack for L300 PSLB8C 0H901X model. Any idea please? Thanks,