EJB entity beans and BC4J

I have looked at BC4J and it looks good. Buy my question is that isn't this frame work in direct conflict with EJB entity beans. I know lot of stuff that is there in BC4J should have been in EJB enitiy beans, but as a developer why should I go with BC4J and not the standard EJB stuff considering the fact that BC4J is properietery to Oracle?Any thoughts?

Vimal,
Without going into exhaustive detail here, I would like to recommend that you take a look at the BC4J Technical White Paper available from the JDeveloper page on OTN (in the 3.0 Technical Information section):
http://technet.oracle.com/products/jdev/info/techwp20/wp.html
Amoung other things to note, BC4J is based on pure Java, and is what we consider a 'white box', meaning, you as a developer have complete control over what is going on. You can extend any of the code generated to customize it.
Primarily though, the major benefit of BC4J is that we have taken care of most of the complicated communication code for you. Communication between the client and the data server, transaction handling, row locking, etc are already written for you. You just use, extend, customize what we have provided.
In addition, BC4J allows you flexibility in your deployment environment decision. Regardless of where and how you deploy your BC4J Application Module, the client is unchanged.
Those are the key advantages. Again, for more details, I would take a look at the white paper to see if it more fully addresses your questions.

Similar Messages

  • How to use same transaction when calling CMP entity beans and  DAO (JDBC)

    We are currently using Weblogic 8.1 SP2 with an Oracle 10g database (using XA thin and non-XA drivers).
    We have a session bean that invokes an entity bean and a DAO (data access object pattern) in order to add data in 2 separate tables (account and history). Rows are added to the first (account) table using a CMP Entity bean while inserts are done in the 2nd (history) table using a DAO. Here is some pseudo code:
    addHistorySessionBean (trans-attribute="Required")
    begin
    Step #1 - call addAccountEntityBean (trans- attribute="Required")
    Step #2 - call addHistoryDAO (get datasource, connection)
    end
    The 2nd table (history) has a foreign key constraint to ensure that the corresponding key exists in the first (account) table. Unfortunately, DAO inserts on the 2nd (history) table fail with a foreign key constraint violation (INTEGRITY CONSTRAINT VIOLATION - PARENT KEY NOT FOUND!) since they cannot see the row added to the 1st (account) table in step #1 by the CMP entity bean.
    How does one ensure that all this is done in a single transaction ? It appears that the app server creates two seperate transactions (one for the session bean facade and the entity bean and a 2nd transaction (when we retrieve a connection using the same data source JNDI name) for the DAO.
    A post on server side suggested using a "<resource-ref>" in the session bean to tie the two potentially separate transactions together, but that does not work for us. However, I am not sure if we are doing that correctly. After we define the resource ref in the session facade bean, do we use the resource ref "name" attribute to lookup the datasource or do we still lookup the datasource by JNDI name ? Do we need to define the resource-ref tag in the entity bean also ?
    Does Weblogic allow using a single transaction for this type of a scenario ? How does one specify within Weblogic that the same transaction should be utilized by the entity bean and any subsequent DAOs?
    People have also suggested that we defer constraint checking until the transaction(s) are committed but that sounds like a work acount without addressing this issue. Would postponing the constraint checking in Oracle cause any additional overhead ?
    Any suggestions with specific examples or documentation on how to address this issue will be gratefully appreciated.

    Thanks for your suggestion. Unfortunately, this does not work since it appears that there are 2 separate transactions going on here. One, the original one initiated by the session bean and used by the entity bean and the other initiated by the DAO. Any other ideas appreciated.
    Hi,
    Try setting the delay-database-inserts tag to
    ejbCreate in RDBMS descriptor file.
    http://bernal/stage/wls/docs81/ejb/DDreference-cmp-jar
    .html#1113981
    vasanthi ramesh

  • How to delete a database record by using EJB entity beans

    Hi, All,
    Does anyone know how to use entity bean to delete a database record? I have all the EJB entity beans created, including access beans to each. I can successfully create records, find and update records, however, I haven't find a way to delete records yet.
    Your response is appreciated.
    Cathy

    Please see EJB Forums for continue discussion on this subject.
    Reference titile: "how to delete database record by using CMP entity beans "

  • Are EJB ( entity beans) are cached ?

    Are EJB ( entity beans) are cached ?
    I have a doubt here . As per my understanding , the entity beans are cached from the database. In that case , If I delete a row in the database by an external application ( say using TOAD tool) , how the Entity bean will be updated / reloaded ? Entity bean will be out of sync then .
    Application server : weblogic/webspehere .

    >
    You can use the refresh method of the EntityManager interface to read new values from the database (if you expect it to be out of sync), and use locks to prevent others from changing your data while the application is performing actions in a transaction.Did you mean I have to write code for this ? can't be made it automatic refresh by the container ? Is there any settings I can configure so that container can do it by itself proactively ?
    Also, using locks ...is this a container settings or I need to configure myself in ejb-jar.xml ? Could you please shed some light here ?

  • Does JServer support EJB/Entity beans

    What version of JServer lives in the following applications, and does it support EJB/Entity Beans or when will it.
    8.1.5 OAS
    8.1.5 8i
    8.1.6 OAS
    8.1.6 8i

    Check out the following link for details about the Beta Program: http://technet.oracle.com/products/oracle8i/java_beta/index.htm
    New features that will be available in the Beta include support for Entity Beans, and support for Servlets. It also includes JServer Accelerator (JServer's Native Compiler).

  • Entity Beans and Session beans to represet Business lOgic

    How cam we implement Entity Beans and Session beans to represent Business Logic.
    Can anyone explain how can we do this.
    Regards...

    I have session beans calling method in entity beans and any client
    doesn't have access to entity beans, only via session beans.
    If i define security policy and method permissions for session beans
    only, do entity beans use that permissions when calling their methods
    from sessions beans OR should i define the security policy for entity
    beans separately?If you want to set the permission on individual
    methods of entity bean ( with different roles)
    you have to do it separately.
    If you want to delegate the Authenticated user along with
    the method call to the Entity Bean you can use
    run-as-identity-principal.
    For more detail please check out the EJB2.0 Spec.
    -utpal

  • EJB 3.0 entity beans and WebDynpro models

    Hi all,
    first off all my setup:
    WebDynpro Development Component: dcA
    EJB Module Development Component: dcB
    i wan't to create Entity Beans in dcB an use it for my model in dcA.
    My questions:
    1. Why does the "New Wizard" only offer EJB 3.0 Session and Message Beans an no Entity Beans? What is the correct way for creating Entity Beans in DevStudio?
    2. Is ist right that i have to define a public Part containing the Entity Bean to make it visible to dcA?
    Regards,
       Christian

    Hi,
    I'm experiencing same problems, is this a bug or an feature?

  • EJB Entity beans ,JDBC Stored procedures

    Hi ,
    I am new to EJB and i have some general questions
    ---Every table in an existing database is an entity bean for my application?
    --- how do i define the queries in the entity bean ? (With PreparedStatement ?)
    ---The persistent fields,the ejbmethods,constructors, the table relationships, the prepared statements and stored procedures, are defined in the entity beans ?
    --- how do i define the primary Keys in an Entity Bean !!! I will use EJB 2.1 and BMP
    thanks in advance ...

    Sandeep...
    I have dblinks going all over the place. What you are talking about is a clustered or distributed database. That is the future (or present ) of large databases. My code is set up because an 'architecture' is not yet available in the database itself to support the concepts I've posted to Steve in other threads.
    I fully believe that we'll eventually have BC4J ( or something like it ) directly in the database. I fully believe that the database will load balance these across a cluster of databases, within the database structure itself. For example... there is NOTHING to stop the JVM from deciding that it needs to load balance and submit the thread to a remote machine for processing... independent of creating a "middle tier" outside the database.
    I believed that client-server model was flawed for most (not all) applications in the 80's. Looking at the "application tier" model I have the same feeling that we're creating an overly complex scheme at the wrong layer... just pushed back one stage so that we have to rewrite everything...
    If you go back to the megalithic server design ( or cluster of servers ) with a thin thin front end... just why is the middle tier needed under the scenario I've outlined?
    As such, stored procedures/triggers be they in java or pl/sql seems best bet to me... seeing's how a call spec to java or a pl/sql wrapper is transparent to the caller using jdbc or any other future technology.
    grin Way outside the scope of the universe today... I see it as inevitable.
    null

  • Problems accessing tables in oracle database with ejb entity bean

    I have created a simple server application that uses an entity bean (version 2.0) for an existing table in oracle database, and a session bean that is used as an outside interface for performing operations on that table.
    after deploying the server and client application the client attempts to perform an operation with the session bean remote interface it obtained.
    The session bean uses a locale interface to communicate with the entity bean, but when it tries to use its methods (create, findByXXX) it always get the following Exception: java.sql.SQLException: ORA-00942: table or view does not exist.
    the table of course exists, and the username password I'm using has all the permissions needed for this table.
    note - I'm using the Forte enterprise edition 4.0 as developer tool.
    I'll be glad to get some help.
    Here is the full stack trace of the exception:
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
    javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
    java.sql.SQLException: ORA-00942: table or view does not exist
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
    at com.sun.ejb.persistence.SQLEngine.ejb20Finder(SQLEngine.java:226)
    at com.sun.ejb.persistence.PartitionImpl.ejbFinder(PartitionImpl.java:736)
    at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM.ejbFindByEmail(UserInfoEJB_PM.java:393)
    at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM_LocalHomeImpl.findByEmail(UserInfoEJB_PM_LocalHomeImpl.java:64)
    at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:77)
    at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:68)
    at com.cti2.telco.core.ejb.UserManagerEJB_EJBLocalObjectImpl.authenticate(UserManagerEJB_EJB
    LocalObjectImpl.java:63)
    at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB.userLogin(TelcoFacadeEJB.java:80)
    at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB_EJBObjectImpl.userLogin(TelcoFacadeEJB_EJBObjectImpl.java:24)
    at com.cti2.telco.core.ejb.dispatch._TelcoFacadeEJB_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
    at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
    ...

    Well it seems like the problems has a simple explanation. The Forte assigns a default table name (<entityName>EJBTable) when creating an entity bean from an existsing table in DB (which is not the same as the one it was created from !!!). Also, for reason unknown, when you deploy these entity beans, it doesn't even create the new table under its new name (even if instructed to).
    So using the Forte we managed to use successfuly only entity beans that were created "from scretch" (when deployed their tables are created).
    Does anyone know how to change the default name the Forte uses, and make it work properly with entity beans created from an existsing table (without going over the xml's) ?

  • Container Managed Entity Beans and Client Identifier in Oracle

    Is it possible to use Container Managed Entity Beans (EJB with CMP)
    in a way that the Oracle database sessions still know the
    individual Client Identifiers of the actual users
    (not just the Identifier of the proxy user defined in the
    Connection Pool)?
    If Yes: How?
    If No: The consequence would be that the
    technologies EJB with CMP cannot be user together with
    Oracle Virtual Private Databases (VPN) because VPN requires
    some kind of Client Identifier.
    I am grateful for any hint.
    Regards,
    Martin Siepmann
    +49 (0)163 / 7765328

    Not quite an auto-incrementing PK, but it is managed by the container. the following is from the turorial
    Generating Primary Key Values
    For some entity beans, the value of a primary key has a meaning for the business entity. For example, in an entity bean that represents a phone call to a support center, the primary key might include a time stamp that indicates when the call was received. But for other beans, the key's value is arbitrary--provided that it's unique. With container-managed persistence, these key values can be generated automatically by the EJB container. To take advantage of this feature, an entity bean must meet these requirements:
    * In the deployment descriptor, the primary key class is defined as a java.lang.Object. The primary key field is not specified.
    * In the home interface, the argument of the findByPrimaryKey method must be a java.lang.Object.
    * In the entity bean class, the return type of the ejbCreate method must be a java.lang.Object.
    In these entity beans, the primary key values are in an internal field that only the EJB container can access. You cannot associate the primary key with a persistent field or any other instance variable. However, you can fetch the bean's primary key by invoking the getPrimaryKey method, and you can locate the bean by invoking its findByPrimaryKey method.
    Maybe that is good enough
    christina

  • Problem deploying EJB entity bean

    Hi all!
    I'm trying to deploy an CMP entity bean with composite primary key.
    My environment is Oracle 8i (8.1.7) on W2K Professional and I'm using JDK 1.3.1_02.
    The error I get is:
    Compiling Stubs...done
    Generating Jar File...done
    Loading EJB Jar file and Comm Stubs Jar file...done
    Generating EJBHome and EJBObject on the server...
    An exception occurred during code generation: null
    I don't understand what am I doing wrong...
    Any help will be highly appreciated.
    [Could anyone point me out sample code for CMP entity beans with composite primary key?]
    Apologies for the length of the POST, just trying to pass as much info as I can...
    The table is the following:
    CREATE TABLE GPS_HIST (
    gps_date_of_fix     VARCHAR2(40) NOT NULL,
    gps_time_of_fix     VARCHAR2(40) NOT NULL,
    issi               NUMBER(10) NOT NULL,
    gps_condition          NUMBER(5),
    gps_latitude          VARCHAR2(40),
    gps_longitude          VARCHAR2(40),
    gps_speed_knt          NUMBER(10),
    constraint gps_hist_pk primary key (gps_date_of_fix, gps_time_of_fix, issi))
    TABLESPACE AVLDATA
    PCTFREE 10     PCTUSED 40
    INITRANS 1     MAXTRANS 255
    STORAGE (
    INITIAL 128K NEXT 128K PCTINCREASE 0
    MINEXTENTS 1 MAXEXTENTS 4096)
    NOCACHE;
    The primary key class is the following:
    package gps;
    public class GPSEntryPK implements java.io.Serializable
         public int ISSI;
         public String gpsTimeOfFix;
         public String gpsDateOfFix;
         public GPSEntryPK() {}
         public GPSEntryPK (String gpsDateOfFix, String gpsTimeOfFix, int ISSI)
              this.gpsDateOfFix = gpsDateOfFix;
              this.gpsTimeOfFix = gpsTimeOfFix;
              this.ISSI = ISSI;
         public String getGPSDateOfFix()
              return this.gpsDateOfFix;
         public String getGPSTimeOfFix()
              return this.gpsTimeOfFix;
         public int getISSI()
              return this.ISSI;
         public boolean equals(Object obj) {
              if ((obj instanceof GPSEntryPK) &&
                   (this.ISSI == ((GPSEntryPK)obj).ISSI) &&
                   (this.gpsTimeOfFix.equals(((GPSEntryPK)obj).gpsTimeOfFix)) &&
                   (this.gpsDateOfFix.equals(((GPSEntryPK)obj).gpsDateOfFix)))
                   return true;
              return false;
         public int hashCode() {
              return (this.gpsTimeOfFix.concat(this.gpsDateOfFix)).hashCode() * this.ISSI;
    The bean implemantation (part of it) is as follows:
    public void setEntityContext(EntityContext ctx)
    this.ctx = ctx;
    Properties props = ctx.getEnvironment();
    public void unsetEntityContext()
    this.ctx = null;
    public GPSEntryPK ejbCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
    String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
    throws CreateException, RemoteException
    try {
    setGPSDateOfFix(gpsDateOfFix);
    setGPSTimeOfFix(gpsTimeOfFix);
    setISSI(ISSI);
    setGPSCondition(gpsCondition);
    setGPSLatitude(gpsLatitude);
    setGPSLongitude(gpsLongitude);
    setGPSSpeedKnt(gpsSpeedKnt);
    } catch (java.rmi.RemoteException e) {
    throw new CreateException();
    return null;
    public GPSEntryPK ejbFindByPrimaryKey(GPSEntryPK pk) throws RemoteException, FinderException {
    return null;
    public void ejbPostCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
    String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
         throws CreateException
    // get primarykey
    GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
    public void ejbActivate() {}
    public void ejbPassivate() {}
    public void ejbRemove() {}
    public void ejbLoad()
    // You can get to the primary key
    GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
    public void ejbStore(){}
    The descriptors are the following:
    "gpsentry.xml"
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems Inc.//DTD Enterprise JavaBeans 1.1//EN" "ejb-jar.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <description>no description</description>
    <ejb-name>GPSEntry</ejb-name>
    <home>gps.GPSEntryHome</home>
    <remote>gps.GPSEntry</remote>
    <ejb-class>gpsServer.GPSEntryBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>gps.GPSEntryPK</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-field><field-name>gpsDateOfFix</field-name></cmp-field>
    <cmp-field><field-name>gpsTimeOfFix</field-name></cmp-field>
    <cmp-field><field-name>ISSI</field-name></cmp-field>
    <env-entry>
    <env-entry-name>realmName</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>gps.realm</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>GPSEntryBean.databaseURL</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>jdbc:oracle:kprb:</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>GPSEntryBean.JDBCDriverName</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>oracle.jdbc.driver.OracleDriver</env-entry-value>
    </env-entry>
    </entity>
    </enterprise-beans>
    </ejb-jar>
    "oracle_gpsentry.xml"
    <?xml version="1.0"?>
    <!DOCTYPE oracle-descriptor PUBLIC "-//Oracle Corporation.//DTD Oracle 1.1//EN" "oracle-ejb-jar.dtd">
    <oracle-descriptor>
    <mappings>
    <ejb-mapping>
    <ejb-name>GPSEntry</ejb-name>
    <jndi-name>test/gpsentry</jndi-name>
    </ejb-mapping>
    </mappings>
    <persistence-provider>
    <description> specifies a type of persistence manager </description>
    <persistence-name>psi-ri</persistence-name>
    <persistence-deployer>oracle.aurora.ejb.persistence.ocmp.OcmpEntityDeployer</persistence-deployer>
    </persistence-provider>
    <persistence-descriptor>
    <description> This specifies a particular type of persistence manager to be used for a bean. param is where you would put bean specific persistence info in the format of params. The deployment process just passes what's in the param to the persistence deployer. For the baby persistence, we do parse the persistence-mapping but for other persistence backend we don't do anything with the params </description>
    <ejb-name>customerbean</ejb-name>
    <persistence-name>psi-ri</persistence-name>
    <psi-ri>
    <schema>AVLMIS</schema>
    <table>gps_hist</table>
    <attr-mapping>
    <field-name>gpsDateOfFix</field-name>
    <column-name>gps_date_of_fix</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>gpsTimeOfFix</field-name>
    <column-name>gps_time_of_fix</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>ISSI</field-name>
    <column-name>issi</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>gpsCondition</field-name>
    <column-name>gps_condition</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>gpsLatitude</field-name>
    <column-name>gps_latitude</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>gpsLongitude</field-name>
    <column-name>gps_longitude</column-name>
    </attr-mapping>
    <attr-mapping>
    <field-name>gpsSpeedKnt</field-name>
    <column-name>gps_speed_knt</column-name>
    </attr-mapping>
    </psi-ri>
    </persistence-descriptor>
    </oracle-descriptor>
    Thanks in advance.

    Hi Nikos,
    I obviously don't know what your entire situation is, but you may not
    be aware that Oracle's DBMS embedded EJB container does not work well,
    and as a result, Oracle decided to replace it with an external EJB
    container which is part of a product called "Oracle Containers for
    J2EE" (otherwise known as "OC4J"). The "other" forum (the J2EE forum)
    deals mainly with OC4J.
    As far as I know, Oracle recommends doing your EJB related work with
    OC4J and not with the embedded EJB container.
    Good Luck,
    Avi. That's correct
    Java code, implementing data bound logic, can still run in the database as Java stored procedures/packages/functions/triggers
    while J2EE componentsdeployed in middle-tier implement business logic. Java in database enable the database to be an active participant to your deployment platform
    in 9iDB R2 you will even be able to call-out Web client (using HTTP Client), EJB client (using oc4jclient.jar) or Web Service client
    (using SOAP libraries)
    Kuassi

  • Entity beans and data synchronization

    I want to use a BMP to represent information about a database entity where the BMP "fields" are actually statistical summaries (e.g., an Account bean where the "field" num_transactions is calculated using a query rather than stored). I want to do this because the queries that generate the summary statistics are costly and I want to cache the results in memory. Since these are "read-only" statistics, I could use DAOs and a Fast Track Reader but I want to make use of the caching and lookup facilities of J2EE for finding accounts that are already cached.
    I only refresh the back end database nightly, so I need to flush all of the values in all cached Account beans nightly. Is there a facility for this type of thing, or do I need to manually control it (e.g., using a "version" number on the data that is checked periodically).
    Thx,
    John H.

    John,
    You might also check your application server's documentation. Weblogic provides a read-only entity bean, whereby you can specify a timeout parameter in your descriptor file. The container will then only call ejbLoad() when the ejb is accessed and the timeout has been passed. This, in effect, provides a caching mechanism.
    Best of luck,
    Richard

  • Entity Beans and Caching

    Hi,
    My environment is:
    - Weblogic 5.1 running on Solaris
    - Oracle 8i database server
    - Two physical servers clustered together to form one logical server
    I can possibly upgrade to Weblogic 6 or later if it'll help solve my
    problem.
    Here's what I'm trying to accomplish:
    I want to write entity beans using bean-managed persistence. The BMP
    part of it is strongly preferred because our DBAs like to see and tune
    all of the queries we send from the application.
    In many cases, the data I'm querying is largely static. I want to
    write EJBs that will cache the data in memory and avoid reading it
    from the database server every time the EJB is invoked, unless it
    knows that the data has changed.
    I've done this successfully with single-server installations, but I'm
    not sure how it'll work with a clustered server. Assuming nothing
    outside of my two Weblogic servers is updating my database, can I
    configure the EJB to have exclusive access to the database and count
    on Weblogic to manage the state between the two servers? Or do I have
    to implement some kind of custom signalling scheme so that an EJB in
    one container can notify any EJBs in the other container with the same
    primary key when it has updated the underlying data?
    I know from experience that the container will call the ejbStore()
    method whenever a transaction ends. My usual BMP pattern in the past
    has been to keep track of whether any data has changed during the
    transaction and update only those database columns, if any, that
    actually changed. But I don't think the store method has any way of
    notifying the container as to whether or not it actually stored
    anything; hence, I can't see how the container would know when to
    order the entity bean on the opposite server to reload itself.
    Thanks.

    The 6.1 implements functionality you want:
    http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1121105
    if you use 5.1 you can use this approach:
    http://dima.dhs.org/misc/readOnlyUpdates.html
    Frank LaRosa <[email protected]> wrote:
    Hi,
    My environment is:
    - Weblogic 5.1 running on Solaris
    - Oracle 8i database server
    - Two physical servers clustered together to form one logical server
    I can possibly upgrade to Weblogic 6 or later if it'll help solve my
    problem.
    Here's what I'm trying to accomplish:
    I want to write entity beans using bean-managed persistence. The BMP
    part of it is strongly preferred because our DBAs like to see and tune
    all of the queries we send from the application.
    In many cases, the data I'm querying is largely static. I want to
    write EJBs that will cache the data in memory and avoid reading it
    from the database server every time the EJB is invoked, unless it
    knows that the data has changed.
    I've done this successfully with single-server installations, but I'm
    not sure how it'll work with a clustered server. Assuming nothing
    outside of my two Weblogic servers is updating my database, can I
    configure the EJB to have exclusive access to the database and count
    on Weblogic to manage the state between the two servers? Or do I have
    to implement some kind of custom signalling scheme so that an EJB in
    one container can notify any EJBs in the other container with the same
    primary key when it has updated the underlying data?
    I know from experience that the container will call the ejbStore()
    method whenever a transaction ends. My usual BMP pattern in the past
    has been to keep track of whether any data has changed during the
    transaction and update only those database columns, if any, that
    actually changed. But I don't think the store method has any way of
    notifying the container as to whether or not it actually stored
    anything; hence, I can't see how the container would know when to
    order the entity bean on the opposite server to reload itself.
    Thanks.--
    Dimitri

  • EJB Entity Beans

    "Entity Beans are suitable for read/write database access when transaction control
    is important. Container managed Entity beans should be suitable for simple entity
    relationships and offer much easier maintenance and development."
    Tell me why or why not you agree with the above statement.
    This is one of the most talked about issues, and I like to see this group's view
    point, regardless of what Sun says in their blueprint.
    On a unrelated note, i like to see what you think about this:
    What are the benefits and disadvantages of using Inner Classes?

    I agree. How are you gonna find the marks without primary key? Sequential seek??
    What you should do is having student_id as primary key of the marks table and create a 1-* relationship between them by student_id.
    Cheers.

  • Strange behavior with entity beans and servlets in a cluster

    We have 2 WebLogic 4.5.1 servers in a cluster with none of the Service
              Packs installed. When a client uses the deployed entity beans or
              servlets they work every other time. The times they do not work nothing
              happens. No exceptions, no responses to the client ( i.e. HTTP 404s ),
              nothing. I suspect something in the cluster setup since we do not have
              these same problems on non-clustered entity beans or servlets. We have
              made sure all the entity beans have the Shared Database flag set on and
              added the delayUpdatesUntilEndOfTx false to the enviroment of the DD.
              That didn't fix the problem. Any ideas?
              Thanks in advance,
              Dallas Dempsey
              DEM - Houston, TX
              

    Do you have log files?
              - Prasad
              Chris Dempsey wrote:
              > We have 2 WebLogic 4.5.1 servers in a cluster with none of the Service
              > Packs installed. When a client uses the deployed entity beans or
              > servlets they work every other time. The times they do not work nothing
              > happens. No exceptions, no responses to the client ( i.e. HTTP 404s ),
              > nothing. I suspect something in the cluster setup since we do not have
              > these same problems on non-clustered entity beans or servlets. We have
              > made sure all the entity beans have the Shared Database flag set on and
              > added the delayUpdatesUntilEndOfTx false to the enviroment of the DD.
              > That didn't fix the problem. Any ideas?
              >
              > Thanks in advance,
              > Dallas Dempsey
              > DEM - Houston, TX
              

Maybe you are looking for