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.

Similar Messages

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

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

  • OC4J -Time out and Oracle sequence problem

    hi
    i m using OC4J to access application which is using java as front and
    and we using oracle sequence with cache as 20.
    so when i accessing application thro' network my sequence skip from 20
    mean 1-21-41-61 is it possible due to if lost connection opened from java for oracle thro' OC4J ? will it keep cache ?or lost ? is it really time out error?
    if then hw to set time out in oracle?
    u can refer below link
    Re: ORABPEL-05002

    i think i may be having the same problem. My table is savings entries out of order. I would assume that each row saved would be in sequence number order...instead it goes from like 963, 964, 678, 679, ....??? wonder why it would place new entries in front of older entries in the table???

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

  • Multiple destination tables, oracle sequence problems

    Hello,
    Please look at this sql - there is 2 steps to add data to 2 destination tables:
    - step1:
    INSERT INTO OBIEKTY (ID_OB, TELEFON, FAX, NR_LOKALU, UWAGI, ULICA, GEOM, NR_BUDYNKU, KOD_POCZTOWY, LISTA_OBIEKTOW, EMAIL, GMINA, NAZWA, WOJEWODZTWO, MIEJSCOWOSC, USUNIETY, POWIAT, JEDNOSTKA_WYJAZDOWA, MIEJSCOWOSC_POCZTY)
    VALUES (OB_SEQ.NEXTVAL, null, null, null, null, 'Legionowa', null, '8', '15-099', '0', null, null, 'WSSE w Białymstoku',null , 'Białystok', null, null, '0', null);
    -step2:
    INSERT INTO ZASOBY (ID_ZAS, UZYT_TWORZACY, UWAGI, UZYT_OST_MODYFIKACJI, DATA_OST_MODYFIKACJI, DYSPONOWALNY, DATA_UTWORZENIA, USUNIETY, ID_SPRZETU, ID_PAT, ID_MAT, ID_INST, ID_KATEGORII, ID_OBIEKT, ID_POZ_SL, ID_OSOBA, IMPORT)
    VALUES (ZAS_SEQ.NEXTVAL, 'import', null, null, null, '0', SYSDATE, '0', null, null, null, null, KTZ_SEQ.CURRVAL, OB_SEQ.CURRVAL, (select p.id_poz_sl from pozycje_slownikow p join slowniki s on p.id_slownika=s.id_sl where s.nazwa like 'TYPY_ZASOBOW' and p.kod = 'OB'), null, '1');
    There are problems with sequences. As you can see, there is OB_SEQ.NEXTVAL in first step and OB_SEQ.CURRVAL in second step. It's impossible to define multiple destination tables in one interface. But, if I do this in multiple interfaces, OB_SEQ.CURRVAL will be undefined in second interface.
    Also, all steps should be performed row by row. So: first step for first row, second step for first row, first step for second row, second step for second row etc. This don't happen if I use multiple interfaces - first step will be performed for all source records and then, second step will be performed for the same records - this is not what I want.
    Do you have any tips what is the best way in this case?

    Hello,
    Unfortunately, problem is not solved still. As you can see, there are 2 sequences, from 2 not joined tables: KTZ_SEQ.CURRVAL, OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL is declared here:
    insert into KATEGORIE_ZASOBU (ID_KTZ, UZYT_TWORZACY, UZYT_OST_MODYFIKACJI, LOKALIZACJA, DZIEDZICZENIE, DATA_OST_MODYFIKACJI, DATA_UTWORZENIA, DYSPONOWALNA, SYSTEMOWA, WYBIERALNA, OPIS, NAZWA, USUNIETA, ID_KATEGORII1, ID_POZ_SL, IMPORT)
    values (KTZ_SEQ.NEXTVAL, 'import', null, '0', '0', null, SYSDATE, '0', '0', '1', null, 'Jednostki WSSE', '0', null, (select p.id_poz_sl from pozycje_slownikow p join slowniki s on p.id_slownika=s.id_sl where s.nazwa like 'TYPY_ZASOBOW' and p.kod = 'OB'), '1');
    So, summary:
    - there are 2 steps (OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL) are set
    - third step: insert some hardcoded data + OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL values.
    Since KATEGORIE_ZASOBU and OBIEKTY are not joined, I can't add them as datasources in my interfaces (how to create join?) and set CURVAL?

  • CMP Entity Bean's problem with MS-SQL Server 2000

    Hi everyone!
    I have a problem regarding CMP Entity Bean on OC4J.
    I made one CMP Entity Bean and deployed it to OC4J.
    It was successful.
    I used MS-SQL Server 2000 as Datasource.
    So, I installed MS-SQL Server's JDBC Driver and add some jar files to classpath.
    And I updated 'data-sources.xml' in OC4J's config directory.
    Then, I updated also 'orion-ejb-jar.xml' in my application's directory.
    I changed data-source's name to my data-source's name which use MS-SQL Server 2000.
    Finally, I started OC4J and EJB Client program which called Enitiy Bean's create method.
    But, The error occured which was 'Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence'.
    What's wrong? I need any helps.
    Here is stack overflow message. Thank you. Best regards.
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence.
         at UserHome_EntityHomeWrapper2.create(UserHome_EntityHomeWrapper2.java:1114)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    at connection to localhost/127.0.0.1 as admin
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1530)
         at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1453)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:53)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
         at __Proxy0.create(Unknown Source)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.create(UserBeanTestClient1.java:73)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.<init>(UserBeanTestClient1.java:49)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.main(UserBeanTestClient1.java:1077)

    Hi Young,
    From the information you have supplied, my guess is that the SQL
    string that OC4J is sending to SQL-Server is incorrect. So it may
    help if you could see the exact SQL string. In order to see the
    SQL string, I suggest you either run OC4J in "debug" mode, or try
    using "P6 Spy".
    The following web page has details on running OC4J in "debug" mode:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    And here is the web page for "P6 Spy"
    http://www.provision6.com/
    And these other web sites may also be of help (in general):
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

  • 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

  • Design problem about repreatable entity relationships

    Hi all!
    As I design the data model (let's name it the ERD, no matter the name is quite unfashonable), I have found almost identical structures of entities and relationships between them, but playing completely different roles in the semantics of the model.
    It obviously makes no sense to implement all such entities separately as the Entity EJB as they are to share most of the fields and methods, but I found no "handsome" solution when trying to implement them as sets of classes and interfaces forming "the abstract EJBs", and then by putting the conrete classes and complementary interfaces at the final packages to create "concrete EJBs". The problem was about types returned by the createXXX and findXXX methods, because they had to return the "abstract" EJBs but the EJB programming contract forces them to return the "concrete" ones, that are unknown to me when defining the "abstract ones". So it cancels the sense for creating them this way. It was also unclear how to operate the relationships in such model.
    The idea was:
    1. I define BaseSthLocalHome extends EJBLocalHome
    2. I define BaseSthLocal extends EJBLocalObject
    3. I define BaseSthBean implements EntityBean
    ... this way I have the "abstract bean", and then I can create many:
    SthOneLocalHome extends BaseSthLocalHome,
    SthOneLocal extends BaseSthLocal,
    SthOneBean extends BaseSthBean ... to have the first "concrete" EJB,
    SthTwoLocalHome extends BaseSthLocalHome... and so on to create the second, third and all the next "concrete" EJBs.
    Anyway, it did not work fine as I defined createXXX and findXXX methods at the BaseSthLocalHome interface - it made sense, because those methods did not depend on the other entities.
    Has anyone some idea of how to solve the design problem? Currently we are at very beginning of the project, so we have some "case study" time, and I would appreciate any solution: redesign of the data model, extraction of new EJB modules or any use of the objective inheritance.
    Thanks in advance!
    Marcin Gawlik

    Again me - I now it is a bad idea to reply for own messages, but I have just checked a new idea:
    The problem was about re-using the same components in different roles. I tried to do that by creating subclasses of the EJB classes, but it did not work. So I tried to define multiple entity EJBs that have the same class.
    Considering the given example, it would look:
    1. public interface BaseSthLocalHome extends EJBLocalHome
    2. public interface BaseSthLocal extends EJBLocalObject
    3. public abstract class BaseSthBean implements EntityBean
    ... then I created the deployment descriptor that deploys this pack of class and interfaces as three separate CMP Entity Beans:
    1. deploy BaseSthBean as the SthOne CMP entity EJB
    2. deploy BaseSthBean as the SthTwo CMP entity EJB
    3. ... and so one
    The question is: IS THERE ANY CONTRA FOR THIS WAY OF DEPLOYING EJBS? Is there any reason for not to use the same class and its complementary interfaces many times to create many separate enity EJBs working within the same EJB module?
    Thanks in advance!
    Gaw

  • 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

  • Deploying CMP Entity Beans in Weblogic

    How to generate/convert the Orion xml file to Weblogic_RDBMS ?
    Thx

    petstore 1.3 will be available for the upcoming beta of weblogic 7.0...
    Andrew Sliwkowski(BEA)
    [email protected]
    "Nitin Sawant" <[email protected]> wrote in message
    news:3c04f6cd$[email protected]..
    >
    Appreciate if you can share your plans on releasing a petstore 1.3 patchfor weblogic.
    >
    >
    i am having problems deploying CMP Entity Beans in petstore 1.3 where theprimary
    key class is defined as java.lang.Object in the ejb-jar.xml descriptor(<prim-key-class>java.lang.Object</prim-key-class>).
    Does weblogic 6.1 with 1.3 features enabled support the above feature.
    Thanks,

  • 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

  • Problem deploying entity ejb CMP

    hello
    when i deploy CMP entity bean in weblogic 5.1
    i get an error "could not make connection to pool"
    i am using oracle thin driver. connection pool
    is created when i start the server but bean could not deploy
    please help
    thanx

    First, set the server to display all logging messages (not just errors), then when you deploy the ejb see what messages happen. I had similar problems when we were deploying on Weblogic 7.0 (with thin Oracle driver).
    Also, be sure you have downloaded the latest Oracle driver classes12.zip file and put it into the weblogic server directory - that can cause problems too.

  • Using oracle db sequence for auto generating of PKs for CMP entity beans

    Hi,
    I have read quite a number of threads about (auto) generation of keys for primary keys for the CMP entity beans.
    My requirement is I am migrating an application deployed on Weblogic to oc4j. The application is using cmp entity beans with auto key generation using a sequence in the Oracle db. This is specified in weblogic-cmp-rdbms-jar.xml file like below:
    <automatic-key-generation>
    <generator-type>Oracle</generator-type>
    <generator-name>REPUSER.DEPT_REPORT_SEQ</generator-name>
    <key-cache-size>1</key-cache-size>
    </automatic-key-generation>
    In the ejb-jar.xml, it is specified as:
    <prim-key-class>java.lang.Integer</prim-key-class>
    <primkey-field>id</primkey-field>
    Now, I need to migrate this to oc4j. Can somebody suggest me options and clarify my questions kindly?
    1) I have read articles that say that in the ejb-jar.xml, we need to specify <prim-key-class>java.lang.Object</prim-key-class> and this will create a column called 'autoid' in the respective entity table in the Oracle db.
    - How can I use this to assign the value to my primary field, say, id?
    2) Now, with the latest oc4j, can I use Oracle database sequence as the key generator for the values of the PKs just by specifying in the xml descriptor ejb-jar.xml?
    2.a) If yes, is there any article that explains with the code?
    2.b) If no, what are the alternatives I have?
    I have read many discussions that say that we can create a stateless session bean that can lookup the database sequence using simple JDBC call to return the nextval of the sequence. The SSB should be called in the ejbCreate() of the entity bean.
    My related question is, what is recommended for oc4j? What are limitations of the various options for the latest oc4j available?
    How should I go about deploying this kind of ejbs in oc4j?
    Any help and pointers are welcome. Please help.
    Thanks a lot.
    Vadi

    Hello ,
    Instead of exposing a get/set method for each arribute of your bean (corresponding to database table) expose only one object.
    For example
    public class CustomerBean implements javax.ejb.EntityBean{
    private CustomerVO objCustomer;
    private String customerName;
    private String customerMail;
    private String customerType;
    public CustomerVO getCustomer(){
    return this.objCustomer;
    public void setCustomer(CustomerVO objCustomer){
    this.objCustomer = objCustomer;
    public void ejbStore(){
    customerName = objCustomer.getName();
    customerMail = objCustomer.getMail();
    customerType = objCustomer.getType();
    HTH
    VJ

Maybe you are looking for

  • LR 2.4 Upgrade issue

    I have just upgraded to V2.4 from V2.1 and now i cannot see my photos, the thumbnails only show up as grey blocks, does anybody know what has gone wrong?

  • How to fetch the perticular line of a internal Table

    Hi Friends, I am using Function Module  VC_I_GET_CONFIGURATION and I am passing the instance Number. Now i am getting 18 records in my ITAB.Here from this ITAB i need only ATBEZ = RELAY TYPES & ATBEZ = CASE Records.Only for the mentioned conditions i

  • Error rendeing JSP

    Hi All, Im using JSPDYNPAGE. Im getting this error while rendering my JSP. #1.5 #00E0ED0BA5EF007C00000B340000451600044F579C50F98A#1213137610143#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#BHARDWS#1916##n/a##798c7830373b11dd82790

  • Add AdHoc on Header Level SC within Status "In Revision" (BRF SRM 7.0)

    Hi all, we have implemented a n-step approval workflow within SRM 7.0 (BRF) If the SC is created, user can add AdHoc approvers on header level. Problem: If an approver rejects or changes the SC, SC is sent back to requisitioner and he has to accept t

  • Is there a way to stop the missed text messages/calls to be displayed

    On the screen? In other words, they are listed as the number of text messages "not read" but does not show "Susan - Why are you ignoring me?!?" instead I just see that I have 15 unread messages as a number under my Text icon. Which means I have 15 me