Entity beans not understood

hello,
I am new to ejb. I know that I have come to the right technology and now to the right forum. I have got quite a good grasp on session beans but I don't understand the entity beans.
I have a couple of questions.
Firstly if every bean represents a single record in a database then what's th logic behind having these beans in the first place. suppose I have about 10 milion records in one of my table then does that mean I have 10000000 instences of that entity bean? and what will be the advantage of such an arrangement.
secondly, do I always need entity beans to manage data from a database? I mean what is wrong if I do all that in a session bean? I do connect to a database with jdbc in servlets and jsp, so what is the problem in doing same in a session bean.
and one general question, how heavy is the remote object on the client machine, what I am asking is, if when I locate the bean using the home interface or home object if you like it, I get access to the remote object. so how heavy is the remote object when I download it on my client machine?
thanks
Krishnakant.

Hi,
If you want to have 10 million records it is not necessarily 10 million Entity Beans will be instatiated. EJB container pools the EntityBeans and uses then accordingly.
Writing DataBase code in Servlets/JSP is not a good idea. If you want to get the benefits of layered Architecture we have to follow certain design patterns. DB operations can be handled trhu EntityBeans are DAO factories.

Similar Messages

  • Ejb3 entity bean not generating valid sql for postgres 8.1

    Hello,
    I originally posted this on the jboss seam board as I ran across this error on a seam test example, but it seems it's more generally applicable to ejb3 entity beans not generating sql that postgres can understand. I'll post my message below, all replies are appreciated.
    I'm going through the hello world example from the seam book, and I'm getting an error I cannot resolve, that with an auto generated sql statement, that's not valid for postgres 8.1, the database I'm on. Here's my error:
    17:40:31,370 INFO [STDOUT] Hibernate: select next value for person_id_seq from dual_person_id_seq
    17:40:31,394 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 42601
    17:40:31,394 ERROR [JDBCExceptionReporter] ERROR: syntax error at or near "value"
    17:40:31,396 FATAL [application] javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
    javax.faces.el.EvaluationException: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
    Here's the table definition
    - create table Person (id bigint not null, name varchar(255), primary key (id))
    - create table dual_person_id_seq (zero integer)
    - create sequence person_id_seq start with 1 increment by 1
    and here's the entity bean:
    @Entity
    @Name("person")
    @Table(name="person")
    @SequenceGenerator(name="person_sequence", sequenceName="person_id_seq")
    public class Person implements Serializable {
    private long id;
    private String name;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="person_sequence")
    public long getId() { return id;}
    public void setId(long id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    How do I get it to generate a valid sql statement for postgres?

    I think you should try putting the sequence generator annotation over the primary key field. Try it and be sure it works.
    regards,
    Michael

  • Entity beans not loaded due to problem loading WebLogic_RDBMS.jar dynamically

    Hi,
    I'm new to WebLogic so bear with me! When I start WebLogic (using
    Microsofts SDK for Java 4.0), all me session beans load up fine, but none of
    my entity beans load. The error I get for each is:
    [EJB]: Server cannot load: d:\weblogic\lib\persistence\WebLogic_RDBMS.jar
    dynamically. Attempting to load from classpath
    ... and then it goes on to say that it could not deploy the entity bean jar
    file giving a list of possible reasons. I'm guessing that the problem stems
    from the fact that the persistence jar file could not be loaded (correct me
    if I'm wrong!).
    Has anyone come across this before? I have included the WebLogic_RDBMS.jar
    file in my classpath when I start WebLogic to see if this would help but to
    no avail.
    Any help would be really appreciated.
    Thanks,
    Ciaran

    Please see my response in the ejb newsgroup.
    -- Rob
    Ciaran Diver wrote:
    >
    Hi,
    I'm new to WebLogic so bear with me! When I start WebLogic (using
    Microsofts SDK for Java 4.0), all me session beans load up fine, but none of
    my entity beans load. The error I get for each is:
    [EJB]: Server cannot load: d:\weblogic\lib\persistence\WebLogic_RDBMS.jar
    dynamically. Attempting to load from classpath
    ... and then it goes on to say that it could not deploy the entity bean jar
    file giving a list of possible reasons. I'm guessing that the problem stems
    from the fact that the persistence jar file could not be loaded (correct me
    if I'm wrong!).
    Has anyone come across this before? I have included the WebLogic_RDBMS.jar
    file in my classpath when I start WebLogic to see if this would help but to
    no avail.
    Any help would be really appreciated.
    Thanks,
    Ciaran--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Entity Beans not getting garbage collected

    Hi,
    I am developing an application that is using EJBs utilizing several common design patterns (i.e. Session Facade, DAO, and Fast Lane Reader). All of the patterns used have come from books by Sun Microsystems Press.
    As I have understood the pattern, the Session Facade pattern uses Stateless Session Beans (SLSB) to implement a desired functionality and accesses the entity beans locally. The results from the entity beans are placed into Value Objects and passed back to the client separating any direct access with the entity beans from the client. In my case, I am using BMP for my entity beans.
    The problem I am seeing with Optimizeit is that none of my entity beans are getting garbage collected despite no references to them. The SLSB creates what entities it needs to perform a task at the local level, puts the data into a value object and goes out of scope.
    Shouldn't the entity beans get removed if the object that references them has gone away or am I missing something?
    Is there a proper way to set an entity bean (or any EJB for that matter) for garbage collection.
    thanks in advance for any help...

    You might even discover that entity beans can get created even before you use them.
    Your application server creates "pools" of bean instances that it can use when it needs to. It is part of this role, and is done in order to optimize performances.
    You cannot force them to be garbage collected. Even if you stop referencing them, the app server will.
    When your create references to a bean, it (usually) won't create an instance. It will take an existing one, and load data into it, using ejbCreate or ejbActivate.
    Hope this helps.
    /Stephane

  • Value string (primary key) could not pass to entity bean

    database server 3.23.57
    application server Jboss 3.07
    ide jbuilder8
    i am using session bean to wrap entity bean where it calls for entity bean to lookup the databse.
    value entered in client application could not be passed from session bean to entity bean.
    it is a jtextfield thta capture string as input which is the customer id. it is also the primary key. session bean managed to get the value but it was then became null when i pass to entity bean.
    may i know wat could be the problem that is causing this?
    application server not suporting this feature???? or it is th elogic problem .. or i have miss ot some code somewhere.?

    Sounds like a code problem.

  • Why Interceptors are not used in Entity beans?

    Why Interceptors are not used in Entity beans?
    Interceptors can be used in MDB, Session bean but not in Entity bean....why so?
    Thanks,
    Rahul.

    Hi,
    why batch updations are not prefered in entity beansPlease refer the specification of ejb and find out what the entity bean is meant for.In short the emtity bean represents the object state which can be persisted.
    Talking regarding the batch updations does not make sense , also the entity bean represents the row of the table mapped to the Object(java Object).
    Regards
    Vicky

  • Load balancing not happending but fail over is for Read only Entity beans

              The following are the configuration.
              Two NT servers with WL5.1 sp9 having only EJBs(Read only entity beans)
              One Client with WL5.1 sp9 having servlet/java application as
              EJB client.
              I am trying to make a call like findbyprimarykey in one of the
              entity bean. I could see the request is being directed only to the one of the
              server always. When I bring that server, fail over is happening to the other server.
              Here are the settings I have in the ejb-jar.xml :
                        <entity>
                             <ejb-name>device.StartHome</ejb-name>
                             <home>com.wl.api.device.StartHome</home>
                             <remote>com.wl.api.device.StartRemote</remote>
                             <ejb-class>com.wl.server.device.StartImpl</ejb-class>
                             <persistence-type>Bean</persistence-type>
                             <prim-key-class>java.lang.Long</prim-key-class>
                             <reentrant>False</reentrant>
                             <resource-ref>
                                  <res-ref-name>jdbc/wlPool</res-ref-name>
                                  <res-type>javax.sql.DataSource</res-type>
                                  <res-auth>Container</res-auth>
                             </resource-ref>
                        </entity>
              Here are the settings I have in the weblogic-ejb-jar.xml.
              <weblogic-enterprise-bean>
                        <ejb-name>device.StartHome</ejb-name>
                        <caching-descriptor>
                             <max-beans-in-cache>50</max-beans-in-cache>
                             <cache-strategy>Read-Only</cache-strategy>
                             <read-timeout-seconds>900</read-timeout-seconds>
                        </caching-descriptor>
                        <reference-descriptor>
                             <resource-description>
                                  <res-ref-name>jdbc/wlPool</res-ref-name>
                                  <jndi-name>weblogic.jdbc.pool.wlPool</jndi-name>
                             </resource-description>
                        </reference-descriptor>
                        <enable-call-by-reference>False</enable-call-by-reference>
                        <jndi-name>device.StartHome</jndi-name>
                   </weblogic-enterprise-bean>
              Am I doin any mistake in this?
              Any one's help is appreciated.
              Thanks
              Suresh
              

    we are using 5.1
              "Gene Chuang" <[email protected]> wrote in message
              news:[email protected]...
              > Colocation optimization occurs if your client resides in the same
              container (and also in the same
              > EAR for 6.0) as your ejbs.
              >
              > Gene
              >
              > "Suresh" <[email protected]> wrote in message
              news:[email protected]...
              > > Ok....the ejb-call-by-reference set to true is making the call to one
              server
              > > only. i am not sure why it is. I removed the property name and it
              works.
              > > Also I have one question, in our prduct environment, when i cache the
              ejb
              > > home it is not doing the load balancing. can any one help me for that.
              > > thanks
              > >
              > > Mike,
              > > From the sample pgm I sent, even from single client calls get load
              > > balanced.
              > >
              > > Suresh
              > >
              > >
              > > "Gene Chuang" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > In WL, LoadBalancing will ONLY WORK if you reuse your EJBHome! Take
              your
              > > StartEndPointHome lookup
              > > > out of your for loop and see if this fixes your problem.
              > > >
              > > > I've seen this discussion in ejb-interest, and some other vendor
              (Borland,
              > > I believe it is), brings
              > > > up an interesting point: Clustering and LoadBalance is not in the
              J2EE
              > > specs, hence implementation
              > > > is totally up to the vendor. Weblogic loadbalances from the remote
              > > interfaces (EJBObject, EJBHome,
              > > > etc..), while Borland loadbalances from JNDI Context lookup.
              > > >
              > > > Let me suggest a third implmentation: loadbalance from BOTH Context
              > > lookup as well as stub method
              > > > invocation! Or create a smart replica-aware list manager which
              persists
              > > on the client thread
              > > > (ThreadLocal) and is aware of lookup/evocation history. Hence if I do
              the
              > > following in a client
              > > > hitting a 3 node cluster, I'll still get perfect round-robining
              regardless
              > > of what I do on the
              > > > client side:
              > > >
              > > > InitialContext ctxt = new InitialContext();
              > > > EJBHome myHome = ctxt.lookup(MY_BEAN);
              > > > myHome.findByPrimaryKey(pk); <== hits Node #1
              > > > myHome = ctxt.lookup(MY_BEAN);
              > > > myHome.findByPrimaryKey(pk); <== hits Node #2
              > > > myHome.findByPrimaryKey(pk); <== hits Node #3
              > > > myHome = ctxt.lookup(MY_BEAN);
              > > > myHome.findByPrimaryKey(pk); <== hits Node #1
              > > > ...
              > > >
              > > >
              > > > Gene
              > > >
              > > > "Suresh" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > > Mike ,
              > > > >
              > > > > Do you have any reasons for the total number of machines to be 10.
              > > > >
              > > > > I tried with 7 machines.
              > > > >
              > > > >
              > > > > Here is my sample client java application running individual in the
              > > seven
              > > > > machines.
              > > > >
              > > > > StartEndPointHome =
              > > > > (StartEndPointHome)ctx.lookup("dev.StartEndPointHome");
              > > > > for(;;)
              > > > > {
              > > > > // logMsg(" --in loop "+currentTime);
              > > > > if (currentTime > nextRefereshTime)
              > > > > {
              > > > > logMsg("****- going to call");
              > > > > currentTime=getSystemTime();
              > > > > nextRefereshTime=currentTime+timeInterval;
              > > > > StartEndPointHome =
              > > > > (StartEndPointHome)ctx.lookup("dev.StartEndPointHome");
              > > > > long rndno=(long)(Math.random()*10)+range;
              > > > > logMsg(" going to call remotestub"+rndno);
              > > > > retVal =
              > > > >
              > >
              ((StartEndPointHome)getStartHome()).findByNumber("pe"+rndno+"_mportal_dsk36.
              > > > > mportal.com");
              > > > >
              > > > > logMsg("**++- called stub");
              > > > > }
              > > > >
              > > > >
              > > > >
              > > > > The range value is different for each of the machines in the
              cluster.
              > > > >
              > > > > If the first request starts at srv1, all request starts hitting the
              same
              > > > > server.
              > > > > If the first request starts at srv2, all request starts hitting the
              same
              > > > > server.
              > > > >
              > > > > I have the following for the url , user and pwd values for the
              context
              > > .
              > > > >
              > > > > public static String url="t3://10.11.12.14,10.11.12.117:8000";
              > > > > public static String user="guest";
              > > > > public static String password="guest";
              > > > >
              > > > >
              > > > >
              > > > > It would be great if you could help me.
              > > > >
              > > > > Thanks
              > > > > suresh
              > > > >
              > > > >
              > > > > "Mike Reiche" <[email protected]> wrote in message
              > > > > news:[email protected]...
              > > > > >
              > > > > > If you have only one client don't be surprised if you only hit one
              > > server.
              > > > > Try
              > > > > > running ten different clients and see if the hit the same server.
              > > > > >
              > > > > > Mike
              > > > > >
              > > > > >
              > > > > > "suresh" <[email protected]> wrote:
              > > > > > >
              > > > > > >The following are the configuration.
              > > > > > >
              > > > > > > Two NT servers with WL5.1 sp9 having only EJBs(Read only entity
              > > beans)
              > > > > > >
              > > > > > > One Client with WL5.1 sp9 having servlet/java application as
              > > > > > > EJB client.
              > > > > > >
              > > > > > >
              > > > > > >I am trying to make a call like findbyprimarykey in one of the
              > > > > > >entity bean. I could see the request is being directed only to
              the
              > > one
              > > > > > >of the
              > > > > > >server always. When I bring that server, fail over is happening
              to
              > > the
              > > > > > >other server.
              > > > > > >
              > > > > > >
              > > > > > >Here are the settings I have in the ejb-jar.xml :
              > > > > > > <entity>
              > > > > > > <ejb-name>device.StartHome</ejb-name>
              > > > > > > <home>com.wl.api.device.StartHome</home>
              > > > > > > <remote>com.wl.api.device.StartRemote</remote>
              > > > > > > <ejb-class>com.wl.server.device.StartImpl</ejb-class>
              > > > > > > <persistence-type>Bean</persistence-type>
              > > > > > > <prim-key-class>java.lang.Long</prim-key-class>
              > > > > > > <reentrant>False</reentrant>
              > > > > > > <resource-ref>
              > > > > > > <res-ref-name>jdbc/wlPool</res-ref-name>
              > > > > > > <res-type>javax.sql.DataSource</res-type>
              > > > > > > <res-auth>Container</res-auth>
              > > > > > > </resource-ref>
              > > > > > > </entity>
              > > > > > >
              > > > > > >
              > > > > > >Here are the settings I have in the weblogic-ejb-jar.xml.
              > > > > > >
              > > > > > ><weblogic-enterprise-bean>
              > > > > > > <ejb-name>device.StartHome</ejb-name>
              > > > > > >
              > > > > > > <caching-descriptor>
              > > > > > > <max-beans-in-cache>50</max-beans-in-cache>
              > > > > > > <cache-strategy>Read-Only</cache-strategy>
              > > > > > > <read-timeout-seconds>900</read-timeout-seconds>
              > > > > > > </caching-descriptor>
              > > > > > >
              > > > > > > <reference-descriptor>
              > > > > > > <resource-description>
              > > > > > > <res-ref-name>jdbc/wlPool</res-ref-name>
              > > > > > > <jndi-name>weblogic.jdbc.pool.wlPool</jndi-name>
              > > > > > > </resource-description>
              > > > > > > </reference-descriptor>
              > > > > > > <enable-call-by-reference>False</enable-call-by-reference>
              > > > > > > <jndi-name>device.StartHome</jndi-name>
              > > > > > > </weblogic-enterprise-bean>
              > > > > > >
              > > > > > >
              > > > > > >Am I doin any mistake in this?
              > > > > > >
              > > > > > >Any one's help is appreciated.
              > > > > > >Thanks
              > > > > > >Suresh
              > > > > >
              > > > >
              > > > >
              > > >
              > > >
              > >
              > >
              >
              >
              

  • I can not fine the Entity Bean's advantage than Java Bean?

    I can not fine the Entity Bean's advantage than Java Bean,
    can you tell me, thanks a lot?

    I can not fine the Entity Bean's advantage than Java
    Bean,
    can you tell me, thanks a lot?I think you should read more of the EJB Spec. You'll find your answer there. But mainly with entities you can have the container manage all the lifecyle of the Bean (transactions, caching, creation, etc...). But entities are not only to map columns in the database, they are supposed to have business code. See more by reading the spec.
    MSB

  • @EJB annotation in entity bean does not work

    I just started with ejb3. I have created a couple of beans. One session bean that looks like this:
    @Stateless
    public class MySessionBean implements MySession
         @Resource(name="jdbc/mydb")
         private DataSource myDB;
    public void someMethod() {
    myDB.getConnection()
    This works great. The other bean is an entity bean, and there the resource injection doesn't work. It looks like this:
    @Entity
    public class MyEntityBean
    @Resource(name="jdbc/mydb")
         private DataSource myDB;
    public void someMethod() {
    myDB.getConnection()
    Is resource injection any different in an entity bean then in a session bean? Both beans belong to the same package and are in the same application, (ear). I have exactly the same problem with @EJB injection: it works fine in the session bean but not in the entity bean...
    Any help is appreciated...
    John

    <code>
    @Entity
    @Table(name = "assetfault")
    @NamedQueries( {@NamedQuery(name = ... )})
    public class Assetfault implements Serializable {
    @javax.ejb.EJB private com.novadent.data.assetmg.sessionbeans.AssetFacadeLocal aF;
    @javax.ejb.EJB private com.novadent.data.assetmg.sessionbeans.AssetfaultFacadeLocal afF;
    </code>
    importing javax.ejb.EJB ?

  • Read Only Entity Bean will not cache

    I'm using the Sun Java Application Server version 8.2. I've created a read only entity bean with a 900 second refresh. This bean has a findAll() method that I've created. The table it is reading from has only 22 rows of data that doesn't change (well, maybe 2 or 3 times a year).
    As stated I've set the read-only property to true and the refresh to 900 seconds. I've also set the caching settings, which I guess i don't really need to mess with from the defaults.
    I do not seem to be achieving any caching at all. My check for this is very simple. I simply load a drop down in the client application with these 22 values. After the intial load I add another row in the database. The newley added row always shows up in the drop down in real time. If i'm caching correctly I shouldn't see this value until the refresh time of 900 seconds. Is there something I am missing? I'm using NetBeans 5.0 to set the values of the entity beans and such.
    Thanks for the help!
    ryan

    Hi Ryan,
    The 8.2 read-only bean implementation still executes non-findByPrimaryKey queries within the database.
    If your application calls findByPrimaryKey or accesses a business method on one of the
    read-only beans returned from a query, that will not result in a database access (unless a refresh
    period boundary is crossed).
    We have added the additional optimization of caching specific result sets of non-findByPrimaryKey
    read-only bean finders in the latest development version of Glassfish (V2).
    https://glassfish.dev.java.net/public/downloadsindex.html#Official_supported_builds
    It will also be available in our Application Server release 9.1. There are no plans to backport this
    optimization to the 8.2 codebase.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • SOS : Bean not found in 'findByName'

    Blank
    Hi Rob,
    thankx for the fast reply and the detailed explanations.
    it's gettings things cleared for me..
    let me explain the way I have understood your explanation.
    I have an EJB (entity bean) called T_Exception. Suppose, this uses few classes in the jar file frwUtil.jar
    So, do you mean to say that I should have a manifest file with the EJB Jar of T_Exception saying "Class-Path: frwUtil.jar" ?
    And this frwUtil.jar should be a part of the .ear where I have T_Exception?
    I have another EJB (session bean) T_ASM which uses T_Exception and also the classes in frwUtil.jar
    So, do you mean to say that I should have a manifest file with the EJB Jar of T_ASM saying something like
    "Class-Path: T_Exception.jar frwUtil.jar" or it just have to be "Class-Path: T_Exception.jar" ?
    And this T_Exception.jar or frwUtil.jar doesn't have to be a part of this .ear file it the previous .ear file is already deployed, right?
    Please correct me if am wrong.
    In short, you are telling me that a support class or jar file which is deployed as part of an .ear file into an application server will be available for another EJB / class file in another .ear file which is also deployed after that. Am I right? I am getting confused in these areas.
    Another doubt is about the significance of manifest files.
    Is it something like one manifest file per a package / folder or something?
    Can I have more than one manifest file for the same package? doesn't sounds logical but just to know
    where and all manifest file comes into play? am not sure abt this..
    Is there some good tutorial available to learn more about this? if yes, please let me know!
    Like you said, setting the $CLASSPATH is definitely a bad practice. We are going to aviod that once this starts working. Thanks for your suggestion.
    regarding dOubt 3 -
    For your reference, below is the erorr that I got -
    javax.ejb.ObjectNotFoundException: Bean not found in 'findByName'.
    at com.tech.framework.propertyEJB.PropertyEJB_kzue3c__WebLogic_CMP_RDBMS.ejbFindByName(PropertyEJB_kzue3c__WebLogic_CMP_RDBMS.java:2001)
    at java.lang.reflect.Method.invoke(Native Method)
    the deployment of the bean goes without an error.
    and it doesn't look like a Finder exception also, right?
    and that's where am confused.
    the same bean is working without any problems like this in 2 - 3 application server instances.
    For the same reason, I don't think that there's a prob with the EJB QL used.
    But now we are trying to remotely deploy the EJBs and deployment doesnt give an error too.
    But the very first call to this bean is giving this error only in this set up.
    and we are struggling with this since the past few days.. trying out all possibilities..
    no luck so far.. .:(
    Thankx again.. in advance..
    "Rob Woollen" <[email protected]> wrote in message news:[email protected]...
    ibmMQ wrote:
    Hi Folks..
    sorry but these doubts are probably cause am a new bie..
    dOubt No 2:
    can I put all the support classes / jar files into the server the way I
    deploy a bean?Yes, make a Jar (or jars) that have the support classes. Package them within
    the EAR file and include a Class-Path entry in the manifest of any component
    that uses these classes.
    Here's an example: http://learnweblogic.com/updates/webauction.zip
    Do not put the classes in the $CLASSPATH. You will not be able to redeploy
    them if they are there.
    mean to ask, can I make a .war or .ear file with all these support jar files
    and ca I uplaod to the application server so that when I deploy a bean, it
    will have these necessary dependency classes ready in the server? As of now,
    I set the classpath in the startweblogic.cmd file which requires a server
    restart every now and then I add something to the server classpath.
    dOubt No 3:
    when do I get Bean not found in 'findByName'?
    I am rather confused with this error!
    We'd need some more info here. Are you sure that your EJB-QL is correct?
    -- Rob
    thankx in advance
    mNs
    [att1.html]
    [Blank Bkgrd.gif]

    BlankIs it possible that a corresponding object is not found for this findByName call and hence it throws this?
    because we tried accessing the same bean from an ordinary java client and it works!!!
    but I thought if it's not finding an Object to return for a given key, it throws FinderException!
    am more confused now, I guess..
    mNs
    "ibmMQ" <[email protected]> wrote in message news:[email protected]...
    Hi Rob,
    thankx for the fast reply and the detailed explanations.
    it's gettings things cleared for me..
    let me explain the way I have understood your explanation.
    I have an EJB (entity bean) called T_Exception. Suppose, this uses few classes in the jar file frwUtil.jar
    So, do you mean to say that I should have a manifest file with the EJB Jar of T_Exception saying "Class-Path: frwUtil.jar" ?
    And this frwUtil.jar should be a part of the .ear where I have T_Exception?
    I have another EJB (session bean) T_ASM which uses T_Exception and also the classes in frwUtil.jar
    So, do you mean to say that I should have a manifest file with the EJB Jar of T_ASM saying something like
    "Class-Path: T_Exception.jar frwUtil.jar" or it just have to be "Class-Path: T_Exception.jar" ?
    And this T_Exception.jar or frwUtil.jar doesn't have to be a part of this .ear file it the previous .ear file is already deployed, right?
    Please correct me if am wrong.
    In short, you are telling me that a support class or jar file which is deployed as part of an .ear file into an application server will be available for another EJB / class file in another .ear file which is also deployed after that. Am I right? I am getting confused in these areas.
    Another doubt is about the significance of manifest files.
    Is it something like one manifest file per a package / folder or something?
    Can I have more than one manifest file for the same package? doesn't sounds logical but just to know
    where and all manifest file comes into play? am not sure abt this..
    Is there some good tutorial available to learn more about this? if yes, please let me know!
    Like you said, setting the $CLASSPATH is definitely a bad practice. We are going to aviod that once this starts working. Thanks for your suggestion.
    regarding dOubt 3 -
    For your reference, below is the erorr that I got -
    javax.ejb.ObjectNotFoundException: Bean not found in 'findByName'.
    at com.tech.framework.propertyEJB.PropertyEJB_kzue3c__WebLogic_CMP_RDBMS.ejbFindByName(PropertyEJB_kzue3c__WebLogic_CMP_RDBMS.java:2001)
    at java.lang.reflect.Method.invoke(Native Method)
    the deployment of the bean goes without an error.
    and it doesn't look like a Finder exception also, right?
    and that's where am confused.
    the same bean is working without any problems like this in 2 - 3 application server instances.
    For the same reason, I don't think that there's a prob with the EJB QL used.
    But now we are trying to remotely deploy the EJBs and deployment doesnt give an error too.
    But the very first call to this bean is giving this error only in this set up.
    and we are struggling with this since the past few days.. trying out all possibilities..
    no luck so far.. .:(
    Thankx again.. in advance..
    "Rob Woollen" <[email protected]> wrote in message news:[email protected]...
    > ibmMQ wrote:
    >
    > > Hi Folks..
    > >
    > > sorry but these doubts are probably cause am a new bie..
    > >
    > > dOubt No 2:
    > > can I put all the support classes / jar files into the server the way I
    > > deploy a bean?
    >
    > Yes, make a Jar (or jars) that have the support classes. Package them within
    > the EAR file and include a Class-Path entry in the manifest of any component
    > that uses these classes.
    >
    > Here's an example: http://learnweblogic.com/updates/webauction.zip
    >
    > Do not put the classes in the $CLASSPATH. You will not be able to redeploy
    > them if they are there.
    >
    > >
    > > mean to ask, can I make a .war or .ear file with all these support jar files
    > > and ca I uplaod to the application server so that when I deploy a bean, it
    > > will have these necessary dependency classes ready in the server? As of now,
    > > I set the classpath in the startweblogic.cmd file which requires a server
    > > restart every now and then I add something to the server classpath.
    > >
    > > dOubt No 3:
    > > when do I get Bean not found in 'findByName'?
    > > I am rather confused with this error!
    > >
    >
    > We'd need some more info here. Are you sure that your EJB-QL is correct?
    >
    > -- Rob
    >
    >
    >
    > >
    > > thankx in advance
    > > mNs
    >
    [att1.html]
    [Blank Bkgrd.gif]

  • Basic difference between stateful and entity beans???

    Could anyone please explain the basic diff between stateful bean and an entity bean.as per my understanding,stateful beans are extensions to clients.they perform a job of a client and they r not persistent.also their state goes off when the server crashes or the machine is reeboted.while in contrast,an entity bean can retain its session coz' they represent a persistent field in the DB.What i have seen in few books(O'reilly,etc)where a session bean can insert some values into the DB,which means it also represents a persistent object in the DB,which contradicts the statement that "stateful session beans dont represent any persistent object in the DB".Could anyone please elaborate on this.Thanks in advance.
    Jameel

    Thank u very much crackers for ur valuable
    suggestions.I'll throw a different one in here for free: clarity of writing is a highly-valued and useful skill in a software professional. This is especially true these days when concepts need to be clearly explained to a variety of technical peoples from all over the world. And then there's the other side of the coin: Management.
    You have to get your thoughts across in a very precise manner and, unfortunately for those who have to learn it as a second lanugage, English seems to be the overall preferred medium. Which makes it even more important to use "correct" English in written communications. If you don't, your credibility diminishes and you appear to be (horrors!) unprofessional It's not that much harder to type "you" than it is to use a single letter. Besides, most people that "pay by the byte" appreciate the clarity, as well (as I've seen on Usenet, by way of covering my ass).
    Now, back to our regularly scheduled post...
    Is this wat u were trying to say if i
    understood u correctly.Yes, the EntityBean is directly related to the data being persisted: in this case, a database table. So, using your example from below, the DB table would have two fields: a VARCHAR 'Name' and an INT 'Age.' The EntityBean would have corresponding fields/properties/variables, String name and int age.
    "WHICH BEAN (Entity
    or Sateful Session) SHOULD I GO 4???"No easy answer. The best one is: it depends. On what? It depends upon what you're trying to do with the data, how it's presented/manipulated, load requirements, environmental requirements, caching strategies, and about another dozen or so other high-level requirements.
    My personal preference is if I need caching and the number of EntityBeans actually in existence is pretty "low" (another nebulous and arbitrary value, depending), I'll use a StatelessSessionBean as a Facade (search for "patterns" here in the forum), with the persistence in CMP EntityBeans. Which is influenced by the fact that I like playing with CMP. ;D

  • Entity bean (ejb 3.0) refactoring problem

    I didn't find a better method than regenerating an entity bean after modifying the table definition and renaming the class after deleting the old one.
    I'm not sure i can delete the old class representing the entity bean before regenerating it without any effects into the others entity beans.
    It work fine but still a little problem. The refactoring process didn't change the name of the entity bean into the select clauses into queynamed injection.

    I am facing a similar problem. Does JDeveloper 10g (10.1.3.3.0) provide an automatic process to update an Entity Bean definition when the underlying database table definition changes?
    I also noticed that for JDeveloper to create all the relationships (i.e. @OneToMany, @ManyToOne) between multiple Entity beans, I need to create all the Entity beans together in one pass using the wizard. If two entities depend on each other, and not created together, JDeveloper will not create the relationships between them. Is there a way around that?
    Thank you

  • 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

  • To use Entity Bean or Oracle stored Package?

    Currently, in my project, Weblogic8.1 and Oracle is used, but lots of business logic is implemented using Oracle stored Packages, many of these packages have a package level readonly lookup table(like index-by table or nested table), which is populated with data from database, once the package is called, and is accessed very often in subsequent calls of stored procedures.
    Since, in Weblogic server, a connection pool is maintained, and those package level lookup tables would be stored as session data in oracle PGA, I'm afraid this might cause oracle database server to be overloaded.
    to fully take advantage of middleware cache service that weblogic provide, should I move those business logic out of oracle and implement them using like read only entity bean?
    any help appreciated!

    Its very hard to say without knowing the usage patterns of the data. It sounds like you have a lot of read-only entities. These could be spread around a WLS cluster, therefore there is more scalability and performance with this option. However, I would not neccessarily rewrite business logic from SP into EJB just for middle-tier caching.
    If its a DB intensive app with lots of SQL, then if the calls are within SP's, there is only 1 call from WLS and the DBA ought o be able to tune the DB usin read-ahead and other DBA semantics. If there is locality of reference in the data, again, DB can use read-ahead better than WLS, although RO cache in middle is more scalable than DBMS.
    I wouldnt rewrite business logic from SP to EJB/Entity beans to take advantage of cache, especially if there is no locality of read-only reference to data. Oracle could do this better in my opinion, especially if SP's already exist
    Need for information on the usage patterns of the data - how is it CRUD'd.
    I would use-case the steel threads and put them under test load to see if the SP's really are an issue, since this is an architecture decision. What state is the project at? Live/Dev? Inception?

Maybe you are looking for

  • How to access PXI 5152 from a Laptop via ethernet cable?

    Hi,  I have the following setup.    PXI 1002 chasis          PXI 8175 controller          PXI 6025E DAQ card          PXI 5152 scope           PXI 6602 counter timer.     I have written a program that uses the counter timer for triggering an external

  • Looking for exchange service

    I currently have my iPhone configured with a mobile me Account which I have been pleased with for the Most part. The mobile me syncs with the iPhone and a local outlook client on my ms windows desktop. Calendar contacts and mail all work correctly. I

  • Events - Incorrect Dates after split

    Hi All Wondering if you are having the same issues as I am, or can help.... I have a coupe of cases where I have split an event which took place over a couple of days (I imported the pictures on a specific day, but iPhoto did not create separate even

  • How to Maintain the Pricing Condition Records in CRM

    Hi I am new to the CRM How to maintain the pricing condition records in crm for the particular condition type? as we do in SD(VK11) Thanks

  • Problems Installation OEM 12c on Oracle Linux 6.3 64Bit

    Hi I am seeing the following messages in the logs during installation, it happens when it gets to 20% INFO: Start output from spawned process: INFO: SaveInvWCCE JRE files in Scratch ":0" INFO: oracle.installer.mandatorySetup property is set to false,