Poor performance of CMP entity bean finder that uses unicode notation N''

I am using Weblogic 6.1 with SQL Server 2000. I have an entity bean
with a finder method that does a lookup based on a (indexed) varchar
field. I noticed during testing that the performance of this finder
method was much worse than other finders. I did some profiling of the
SQL calls going from the Weblogic container to the database, and
noticed that the query generated for the finder call used the unicode
notation, which seems to result in very poor performance. If you run
the following two queries through SQL Analyzer (or SQL Profiler),
you'll notice a significant performance hit on the query that uses the
unicode notation:
example of generated SQL:
SELECT WL0.field1, WL0.field2 ... FROM tblAccount WL0 WHERE
WL0.accountId = N'40879'
example of desired SQL:
SELECT WL0.field1, WL0.field2 ... FROM tblAccount WL0 WHERE
WL0.accountId = '40879'
Is there any way to force it to generate the SQL without using the
notation with the unicode 'N'?
Thanks for any help,
Don

Don wrote:
That worked (we use the Weblogic JDBC driver). The performance is MUCH
better! Glad to help.
Is there some place in the documentation where I should have
seen this (ie. where can I find the documentation on other possibly
useful connection properties)?It should be documented in the jdbc driver documents...
Joe
>
Thanks,
Don Tranquillo
Joe Weinstein wrote:
Hi. The driver does this to ensure that any 16-bit character string
that Java has,
is absorbed unaltered into the DBMS. There is no way to know a-priori
whether
the DBMS needs/wants an nvarchar datum or an 8-bit varchar datum. As
you see,
there is a big performance issue. You can tell the jdbc driver to
send data
as 8-bit (without the "N'" prefix) by setting a connection property:
If you are using the weblogic mssqlserver driver, add the
useVarChars=true
property. If you are using the MS free driver or the DataDirect driver,
add a property sendStringParametersAsUnicode=false.
Joe
Don wrote:
I am using Weblogic 6.1 with SQL Server 2000. I have an entity bean
with a finder method that does a lookup based on a (indexed) varchar
field. I noticed during testing that the performance of this finder
method was much worse than other finders. I did some profiling of the
SQL calls going from the Weblogic container to the database, and
noticed that the query generated for the finder call used the unicode
notation, which seems to result in very poor performance. If you run
the following two queries through SQL Analyzer (or SQL Profiler),
you'll notice a significant performance hit on the query that uses the
unicode notation:
example of generated SQL:
SELECT WL0.field1, WL0.field2 ... FROM tblAccount WL0 WHERE
WL0.accountId = N'40879'
example of desired SQL:
SELECT WL0.field1, WL0.field2 ... FROM tblAccount WL0 WHERE
WL0.accountId = '40879'
Is there any way to force it to generate the SQL without using the
notation with the unicode 'N'?
Thanks for any help,
Don

Similar Messages

  • Problem in deploying CMP entity bean 2.0 in J2EE 1.4

    i am trying to deploy a cmp entity bean 2.0 using j2ee1.4 deployment tool. the bean uses sql server as the database. i have successfully created a coonection pool for sql server using j2ee admin console. the entity bean class files are successfully compiled. but while deploying the entity bean i am not able to set the database settings and jndi name for the bean. can one please guide me in the deployment steps in j2ee1.4.
    mohit

    Mohit,
    We are discussing this topic in the fourm below. I'm having the same problem so feel free to join our conversation.
    ~Howard
    http://forum.java.sun.com/thread.jsp?forum=13&thread=478054

  • Bad Performance/OutOfMemory Error in CMP Entity Bean with Large DB

    Hello:
    I have an CMP Entity deployed on WLS 7.0
    The entity bean maps to a table that has 97,480 records.
    It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
    I have a JSP client that invokes the findALL()
    The performance is very poor ~ 150 seconds just to perform the findAll() - (Benchmark
    from within the JSP code)
    If more than one simultaneous call is made then I get outOfMemory Error.
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
    (without max-beans-in-cache directive the performance is worse)
    Is there any documentation available to help us in deploying CMP Entity Beans
    with very large number of records (instances) ?
    Any help is greatly appreciated.
    Regards
    Rajan

    Hi
    You should use a Select Method, it does support cursors.
    Or a Home Select Method combination.
    Regards
    Thomas
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>>
    (without max-beans-in-cache directive the performance is worse)>
    Is there any documentation available to help us in deploying CMP
    Entity Beans with very large number of records (instances) ? Any help
    is greatly appreciated.>
    Regards>
    Rajan>
    >
    "Rajan Jena" <[email protected]> schrieb im Newsbeitrag
    news:3dadd7d1$[email protected]..
    >
    Hello:
    I have an CMP Entity deployed on WLS 7.0
    The entity bean maps to a table that has 97,480 records.
    It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
    I have a JSP client that invokes the findALL()
    The performance is very poor ~ 150 seconds just to perform the findAll() -(Benchmark
    from within the JSP code)
    If more than one simultaneous call is made then I get outOfMemory Error.
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
    (without max-beans-in-cache directive the performance is worse)
    Is there any documentation available to help us in deploying CMP EntityBeans
    with very large number of records (instances) ?
    Any help is greatly appreciated.
    Regards
    Rajan

  • 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

  • Where to see the SQL statement that CMP Entity bean excuted?

    hi, I'm wondering where I can find the SQL that a CMP entity bean executed in a transaction?
    thank you!

    You can do it in many ways. If you are using eclipse then using eclipse
    plugins for weblogic you van do it. I have heard that in weblogic workshop
    also you can do it. If the above do doesn;t solves your problem then check
    this out.
    http://www.p6spy.com/documentation/install.htm
    Hope that helps.
    <Xin Zhuang> wrote in message news:[email protected]..
    hi, I'm wondering where I can find the SQL that a CMP entity bean executed
    in a transaction?
    thank you!

  • How to load the existing data from the databse in the CMP entity bean?

    hello
    my problem is as follows--
    i am creating a CMP entity bean.in these beans client create the data instances using create() function.
    now a entity bean will be created for the newly created data and it's EJBObject will also be formed.
    now we will be able to perform finder methods over them.
    remember these data has been newly created in the database.
    but now if i want to perform the finder methods on the
    existing data in the database( i don't need to use create() fn as i am not "creating" the data.). how will i perform the query over the existing data.
    basically i have to make a CMP bean to extract the data corresponding to a particular condition , from the database table. i don't want to create the data in the database but just find out what data satisfies my condition.
    thanking you
    Prashant

    you have to use findByXXX methods. depending on your appserver you may have to declare them (and eventually the query you want to be used) in the vendor specific deploiement descriptor.
    (e.g. using jboss i don't remember having explicitly declare the findBySomeField method - where someField is a persistent field - in the dd, whereas with bas all finder methods have to be explicitly declared)
    [note that obviously these methods have to be present in your home interface]

  • RE: Accessing a CMP Entity Bean

    Hi There,
    I have written a couple of CMP entity beans. When I run the client application, I am getting a ORB minor code 257. The error message follows. My code works with both BMP entity beans and session beans. Can anyone help? Thanks in advance.
    Aug 21, 2005 10:24:57 PM com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    This is probably not the best forum to get an answer. Try this one instead:
    http://forum.java.sun.com/forum.jspa?forumID=13
    Its difficult to know exactly the source of your problem. If your code works for session beans and Entity beans using BMP then I can only think of the following:
    In a CMP Bean, the ejbLoad and ejbStore methods do nothing. The container performs the load and store for you. I don't know whether leaving code in these methods will cause any problems though.
    You will need to make a few changes to your ejbCreate method though. Suppose your ejbCreate method looks like this:
    public PersonKey ejbCreate(String aFirstName, String aLastName) You still need to initialise the firstName and lastName fields in the bean.
    firstName = aFirstName;
    lastName = aLastName;Normally, the ejbCreate method returns the key value for the created object. Using CMP, you must return null. The container generates the new key value and returns it to the client.
    Not sure if that will help. Post on the link above if not.
    Simon

  • Composite Primary Key in M:N CMP Entity Bean Relationship

    Dear Sir/Madam,
         We are creating an Enterprise Application for our institute using EJB 2.0 specifiactions. In the course of developement, we are facing a problem in writing the CMP Entity Beans with EJB Relationships.
         We are having many to many relationship between two beans such that the primary key of one Entity Bean (let's call it A), serves as the foreign key of another Entity Bean (let's call it B). Further, this primary key of A as foreign key in B, participates in the composite key of B.
         The EJB Specifications require that the primary key field(s) of any bean (B, in our case) declared in the Primary Key class should be the subset of the 'cmp-field' declared in the deployment descriptor for that bean. As I said earlier, we have many to many relationship at play. Hence, we require to keep the foerign key in the 'cmr-field' in lieu of 'cmp-field'. In short, the component of primary key is in 'cmr-field' while, it is needed in both 'cmp-field' and 'cmr-field'. That's perfect from Database point of view but illogical from CMP Entity Bean's view.
         How can we write the deployment descriptor for such a CMP (BMP is working fine for above scenario) Entity Bean? Also, how can we write the Primary Key class? The problem is not just to find the solution, but find under the hood of EJB 2.0 specifications.
         Please help.

    I think you should realise that it would not be convenient to use CMP for everything. It is difficult to define complex relations using CMP. Mostly BMP os preferd since it gives the flexibility for the bean developer.
    Regards
    xH4x0r

  • RE: Consuming and Creating a CMP Entity Bean

    Hi There,
    I have been trying to find an answer for 1 day. I don't know ehre to look next.
    I am creating a CMP entity bean. I have created all the set and get mehtods as abstract functions. I have added a ejbCreate and a matching ejbPostCreate. The class code looks like this.
    public abstract class COrderBean implements EntityBean {
         protected EntityContext entctx;
         //abstract declarations of property accessors
         public abstract int getId();
         public abstract void setId(int intid);
         public abstract String getCustomerID();
         public abstract void setCustomerID(String strcustomerid);
         public abstract Date getDate();
         public abstract void setDate(Date datorder);
         public abstract String getNotes();
         public abstract void setNotes(String strnotes);
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void ejbRemove() {}
         public void ejbLoad() {}
         public void ejbStore() {}
         public void setEntityContext(EntityContext context)
              entctx = context;
         public void unsetEntityContext()
              entctx = null;
         public COrderPK ejbCreate()
              return null;
         public COrderPK ejbCreate(int new_id, String new_customerid, Date new_order_date, String new_notes) throws CreateException
              setId(new_id);
              setCustomerID(new_customerid);
              setDate(new_order_date);
              setNotes(new_notes);
              return new COrderPK(getId());
         public void ejbPostCreate(int id, String customerid, Date order_date, String notes) {}
    My client code works with both BMP entity beans and session beans. It is shown below. I am working with Sun's Application Server 8.0 and I created the database schema with the capture-schema.exe command.
    Properties prps = new Properties();
              props.put("javax.rmi.CORBA.UtilClass","com.sun.corba.ee.impl.javax.rmi.CORBA.Util");
              props.put("org.omg.CORBA.ORBClass","com.sun.corba.ee.impl.orb.ORBImpl");
              props.put("org.omg.CORBA.ORBSingletonClass","com.sun.corba.ee.impl.orb.ORBSingleton");
              Context context = new InitialContext(props);
              Object obj = context.lookup("corbaname:iiop:localhost:3700#COrderBean");
              //Object obj = context.lookup("entitybean.OrderItem");
                   IOrderHome home = (IOrderHome)PortableRemoteObject.narrow(obj,Class.forName("ctaejb.entitybean.order.IOrderHome"));
                   //use create
                   IOrderRemote remote = home.findByPrimaryKey(new COrderPK(1));
                   System.out.println(remote.getDate().toString());
    I am getting the follwing error. Can someone please help. Thanks in advance.
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    Forget it. All the code works. I didn't know that the Sun App Server required a Persistence Manager to work with CMP entity beans. Once I added the persistence manager, all was OK. Have a good day.

  • Catching SQLException in CMP Entity Bean

    I wana catch an SQLException which is raised while updating a record in DB through a CMP Entity bean method (violating a Foriegn key constraint). It throws to the client a RemoteException which contains a RollbackException which further contains an EJBException and finally it contains the required SQLException. The containment of exceptions is like RemoteException contains RollbackException contains EJBException contains SQLException.
    I know I can parse out the SQLException, but what if I wana know that which foriegn key constraint raised this excepton while updation.
    I'm naive in EJB's and I hope the forum will not turn down my trivial question.
    Regards
    Rana

    For example I have a table "Emplyee" having a field key "DeptID", "DeptID" is a foriegn key from table Department.
    I have a user interface which can update "Employee" table and another user interface for updating "Departments" table. I can try to update employee A's "DeptID" to 3 whereas somebody else has deleted "DeptID" 3 from the "Department" table, this results in a foriegn key constraint violation at DB level. Now I wana catch this exception and report it to the client that the updation was not successful. How I can catch this exception.
    The current situation is that the container throws a RemoteException. This RemoteException contains the following nested hierarchy of exceptions
    RollbackException>> EJBException>> SQLException.
    At client side I'm not sure which exception caused the RemoteException until and unless I can find the Deepest exception (SQLException in this case) in the nested hierarchy.
    How I can write the code for handling exception as RemoteException from the container can be in the result of many other Exceptions as well.
    Regards
    Rana

  • Problem when trying to delete CMP entity bean

    Hi,
    When I try to remove a CMP entity bean, I have this error :
    re09.projet_ejb.syndic.AdminException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUnsupportedOptionException: JDO76207: Update of a primary key field is not allowed.It's only happening when I try to remove a bean which has a relation with another bean. The relation type is One to Many. I tried to search on this forum to find an answer but I found nothing that could help me.
    Message was edited by:
    Starship
    Sry I just found the mistake, the cascade delete was not on the right place :s
    Message was edited by:
    Starship

    Got it sorted so I thought I would share the solution here:  The problem wasnt related to LR 5.2 but was to do with Mac OS X 10.8.5 AKA Mountain Lion.  I had also noticed that I was having an issue around deleting anything on my MAC.  When I tried to delete a file from anywhere I was asked to submit my password.  The message I got was finder wants to make a change please submit password.  I checked through the mountain Lion forums and found a solution here; https://discussions.apple.com/message/20499360#20499360%2320499360
    I implemented it and the problem has dissappeared.

  • CMP entity bean update after database update

    I'm new to JDeveloper and J2EE. Since JDev 10.1.3 is now production software I finally got started with it. Everything was quite simple to achieve however I have one problem.
    My current setup is faily easy. I have a statelss session bean and a CMP entity bean using TopLink (both EJB 2.1). Getting them both created went smooth and having the two talk was as easy as pie thanks to Jdev.
    The problem I have is with the entity bean. I'm using a custom finder method to retrieve records using non-PK fields. This works like a charm and I'm getting the data I need. But when I update the data in the database (OracleXE) and I rerun the client I get the old data. The only way for me to get new data is to restart the embedded OC4J server in JDev.
    How can I have the entity bean updated by changes in the database?

    Thanks Avi!
    I spent some time with the documentation and I see I can configure the cache. However how to do this is not clear to me. I have the impression that most of it relates to BMP entity beans.
    Apparantly there is a DoNotCheckCache method I can invoke on the query, but I have no idea how to achieve this...
    Message was edited by:
    Deddiekoel

  • CMP Entity Beans read database row twice?

    Here are two basic questions regarding container managed persistence Entity Beans:
    How many database read operations are performed when a remote reference to a CMP Entity Bean is obtained by a client?
    Is it correct, that each row is read twice?
    For example if a have one row in a database which I want to lookup, AFAIK first the findByPrimaryKey method perfoms a select to lookup the primary key, and then the (container-)ejbLoad method actually reads the row a second time to populate the CMP fields of the bean.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a setXX method is invoked?
    Thanks for any help,
    Robert

    How many database read operations are performed when a
    remote reference to a CMP Entity Bean is obtained by a
    client?
    Is it correct, that each row is read twice?It all depends on the CMP system. A simple system might well hit the database twice, once to validate the primary key and once to load the object's fields. A
    smarter system might try to cache the results from the first, so it didn't need to do the second (although this might be a bit dodgy from a transactional point of view).
    However, a couple of facts about databases come in here. Firstly, the query to check the primary key doesn't actually need to load any data from the table: it just needs to check that the key exists. Thus, it should be possible to handle this query just using the index, not touching the table itself at all. Secondly, databases do their own caching, so if a row was loaded in the first query, there is a good chance that it would still be around for the second.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a
    setXX method is invoked?Under CMP 1.1, UPDATES are typically done at the end of a transaction; if you use container-demarcated transactions, then yes, UPDATES will happen after every call. If the client code sets up its own transaction, then the UPDATE will only happen after several setXXX calls.
    This can be a performance problem. A common solution is the use of coarse-grained detail objects:
    http://java.sun.com/j2ee/blueprints/sample_application/model/ (section 10.4.1.2)

  • Help about Date and Time by CMP entity bean

    I should have two fields in my cmp .one stores current date ,another one stores current time while ejbcreate();
    I should be able to get findmethod findobjectBetween ?! and ?2
    or that sorts of find method.what type of the method should I use.
    java.util.Date or Simply String?
    if I use java.tuil.Date as the type.
    How shoud my ejbcreate method look like?
    public abstract void setDate(Date mydate);
    public abstract Date getDate();
    ejbCreate(String name,String password,Date mydate,Date mytime)
    setDate()
    I suppose I use write a business method getCurrentDate() which uses
    java.util.Date().toLocale,But I think it just returns String
    help pls.

    I am using oc4j(Oracle9iAS (9.0.3.0.0))
    I am getting the following error using Timestamp while deploying cmp entity bean ejb1.1. Thanks...
    Auto-deploying TimestampTestEntity.jar (No previous deployment found)... TimestampTest_EntityBeanWrapper0.java:1558: Missing term.
    if (if(thread.contextContainer != null)
    ^
    TimestampTest_EntityBeanWrapper0.java:1558: ')' expected.
    if (if(thread.contextContainer != null)
    ^
    TimestampTest_EntityBeanWrapper0.java:1559: Invalid expression statement.
    response != null) {if(thread.contextContainer != null)
             ^
    TimestampTest_EntityBeanWrapper0.java:1559: ';' expected.
    response != null) {if(thread.contextContainer != null)
                    ^
    TimestampTest_EntityBeanWrapper0.java:1560: Missing term.
    response.setNanos(if(thread.contextContainer != null)
                      ^
    TimestampTest_EntityBeanWrapper0.java:1560: ')' expected.
    response.setNanos(if(thread.contextContainer != null)
                      ^
    TimestampTest_EntityBeanWrapper0.java:1561: ';' expected.
    response.getNanos());} // generated from BeanMethodCompilation
    ^
    7 errors
    Error compiling F:\oc4j\j2ee\home\applications\TimestampAppl/TimestampTestEntity.jar: Syntax error in source
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

  • Error While Deploying A CMP Entity Bean With A Composite Primary Key

    Hello all,
    I have a problem deploying CMP Entity beans with composite primary keys. I have a CMP Entity Bean, which contains a composite primary key composed of two local stubs. If you know more about this please respond to my post on the EJB forum (subject: CMP Bean Local Stub as a Field of a Primary Key Class).
    In the mean time, can you please tell me what following error message means and how to resolve it? From what I understand it might be a problem with Sun ONE AS 7, but I would like to make sure it's not me doing something wrong.
    [05/Jan/2005:12:49:03] WARNING ( 1896):      Validation error in bean CustomerSubscription: The type of non-static field customer of the key class
    test.subscription.CustomerSubscriptionCMP_1530383317_JDOState$Oid must be primitive or must implement java.io.Serializable.
         Update the type of the key class field.
         Warning: All primary key columns in primary table CustomerSubscription of the bean corresponding to the generated class test.subscription.CustomerSubscriptionCMP_1530383317_JDOState must be mapped to key fields.
         Map the following primary key columns to key fields: CustomerSubscription.CustomerEmail,CustomerSubscription.SubscriptionType. If you already have fields mapped to these columns, verify that they are key fields.Is it enough that a primary key class be serializable or all fields have to implement Serializable or be a primitive?
    Please let me know if you need more information to answer my question.
    Thanks.
    Nikola

    Hi Nikola,
    There are several problems with your CMP bean.
    1. Fields of a Primary Key Class must be a subset of CMP fields, so yes, they must be either a primitive or a Serializable type.
    2. Sun Application Server does not support Primary Key fields of an arbitrary Serializable type (i.e. those that will be stored
    as BLOB in the database), but only primitives, Java wrappers, String, and Date/Time types.
    Do you try to use stubs instead of relationships or for some other reason?
    If it's the former - look at the CMR fields.
    If it's the latter, I suggest to store these fields as regular CMP fields and use some other value as the PK. If you prefer that
    the CMP container generates the PK values, use the Unknown
    PrimaryKey feature.
    Regards,
    -marina

Maybe you are looking for

  • Ripping audio from a .mov

    hey anyone know how to rip the audio from a quicktime move file (.mov)?? cheers.

  • Itunes + quicktime for windows

    i installed itunes + quicktime for windows. and the problem is, itunes doesn;t sync my ipod..so what i did was,i uninstall the itunes and reinstall again but the quicktime is not there anymore?is that normal? and one more thing,after i uninstall and

  • Work item [item number] cannot be executed

    Hi all, I am having a problem with a workflow. I am emailing a url to a supervisor to approve or reject a training request. When I access the url in internet explorer I get a pop up message with the error, "Work item [item number] cannot be executed.

  • Forms 9i in oracle 11 i details .. required

    hi It would really helpful if the details regarding forms 9i in oracle 11i could be mailed to me at [email protected] [email protected] regards susmitha

  • New iPod User and I Cant turn it on

    I just bought an iPod this morning. I plugged it in to the computer, let it charger for about 4 hours and loaded my play list on to it. I then disconnected it from my computer and I cant turn the darn thing on now. Even when I hook it up to the compu