CMP persistence questions

Hi,
I am using JBoss 3.0.6, CMP 2.0, default HyperSonic database.
I wanted to know a few things
(1) If i have to store big sized objects, what is a better idea
-> to store on to the file system and enter the file URL's into the database OR try to store the objects into the database as BLOBS
(2) If we start storing the objects into the filesystem I feel that there is always a risk of someone tampering the data, and i dont want the data to be visible. In such a case what can we do ?
(3) If i choose to store these huge objects into the database ... particularly Hypersonic, what are its limitations ? How big objects can i store in it, and do i need to make any changes in any of the jboss xml files ?
(4) I also read in some forums that storing the data into files is away from the EJB spec .. is it right ?
Any hints or pointers to places that explain these are very much appreciated
Regards
Meka Toka

my answers:
1) I those objects are too big for HyperSonic, then the only choice is file system. If not then it depends of your performance requirements and whether you use local EJB's (with local interfaces). If you transfer large amounts of data to remote EJB's, then it may be not very fast. If it's not a big issue then use database. I would prefer database storage, if possible.
2) You can encrypt files, or/and you can store data digests (SHA or MD5)
in database and verify it every time you read data from files.
3) http://hsqldb.sourceforge.net/doc/hsqlSyntax.html#Datatypes
" In practice, objects of up to a megabyte in size have been successfully used in production databases. "
I don't think you need to specify something special in decriptors or JBoss config files to store objects.
"If JBossCMP cannot find a mapping for a type, it will serialize the object and use the java.lang.Object mapping."
4) It's right. It's NOT recommened by spec. to work with files from EJB's.
Maris Orbidans

Similar Messages

  • CMP Persistence vs. Java DatabaseControl + XMLBean

    I am trying to understand when to use a CMP Entity Bean vs. creating a JAVA database control and mapping the table fields to an XML bean. Is there a short answer? Is there reference material I could read up on?
    1. Which is easiest to develop?
    2. Which is easiest to use?
    3. Which is most flexible?
    4. Which is easiest to maintain?
    Thanks

    I am trying to understand when to use a CMP Entity
    Bean vs. creating a JAVA database control and mapping
    the table fields to an XML bean. Is there a short
    answer? Is there reference material I could read up
    on?
    Speaking from my own experience of using db controls and entity beans (not XML beans) I generaly use dbcontrols for read only operations or when developing in a hurry:
    1. Which is easiest to develop?If your using workshop there isn't much difference although once you create an EJB workshop handles generating the table, with a db control you have to do this your self (amd write all the sql for CRUDs), otherwise is mostly a case of right click and add methods, fields, properties etc. Of course there is no deployment descriptor with a db control. In a recent proof of concept I used a db control as I thought it was slightly faster to put together, although now I would probably just use a CMP bean.
    With a bean you are also forced to use finder methods, a good thing as you get rid of all those null pointer exceptions and tests for empty result sets.
    2. Which is easiest to use?DB control will be easier to use once its written there is less to configure, but again I don't think CMP beans are much harder and because you are forced to handle exceptions your code will be more robost.
    3. Which is most flexible?To wide a question for me.
    4. Which is easiest to maintain?If you look at it in simple terms a db control is easier to maintain, I guess db controls are simple to use and maintain because they should be used to meet simple requirements.
    Hope this helps (waiting for the inevitable storm of disagreement ;) )

  • Just another cmp transaction question

    Hi
    I would like to know if it is possible to manage cmp transaction from the client code. For example I need to
    execute some business method several times but I don't want the container to commit transaction after each execute but only if all executes were successfull.
    Bartek

    I think I understand your post but my problem is rather different. I have a session bean with a business method named process(..) that receives as an argument a org.dom4j.Document object and does an proper action. I works fine when that process() method is called only one . But now I wan't to call it several times , each time with different org.dom4j.Document perhaps and want to have tha transaction commited only after complete whole process. I am quite new I ejbs so it is possible that is quite a silly question but I need surety that the only way to do this is to make an another session bean business method that gets as a parameter for example a collection of org.dom4j.Document objects.
    Thanks for help
    Bartek

  • Persistence Question

    Hi,
    I am attempting to write something like a text game in Java. Obviously for something like this I need to be able to save the state of the program, so I am attempting to use persistence but I am running into a problem. My Game object contains everything to do with the game and I have a StartGame object that performs the saving and loading and calls game object to run.
    I can successfully save and load the game object using File and Object Output/InputStreams but upon loading the Game object no longer has any of the objects it is supposed to have saved. For example, there is a currentRoom pointer that points to an object of type Room (a custom class). I want this (and many other pointers like it) to have their referenced objects saved and still be pointing to them when a file is loaded. Can anyone enlighten me as to why this is not working?
    I guess the alternative might be to save each and every object within Game individually, but from what I have read it seems like it's supposed to be simpler than that. Thanks for any help.

    I realized I made a silly mistake and was writing the wrong file name originally, but now I have another problem in that it will not even write the game object to the ObjectOutputStream.
    This is the class that runs the game:
    import java.io.*;
    public class StartGame2
         static Game game;
         static boolean runOnce = true;
         public static void main(String args[])
              game = new Game();
              while(!game.exit)
                   game.load = false;
                   game.save = false;
                   game.runGame();
                   if(game.save)
                        save(game.saveName);
                   if(game.load)
                        load(game.loadName);
              System.exit(0);
         static void save(String saveName)
              try
                   // Create a file to write game system
                   FileOutputStream out = new FileOutputStream (saveName);
                   // Create an object output stream, linked to out
                   ObjectOutputStream objectOut = new ObjectOutputStream (out);                    
                   // Write game to disk
                   objectOut.writeObject (game);               
                   // Close object output stream
                   objectOut.close();
                   Game.print("Game saved as " + saveName);
              catch (Exception e)
                   System.err.println ("Unable to create game data");
         static void load(String loadName)
              FileInputStream fin = null;
              ObjectInputStream objectIn = null;
              try
                   // Create a file input stream
                   fin = new FileInputStream(loadName);
                   // Create an object input stream
                   objectIn = new ObjectInputStream(fin);
                   // Read an object in from object store, and cast it to a game
                   game = (Game) objectIn.readObject();
              catch (Exception e)
                   Game.print("Failed to load.");
    }//End startGameThe Game class itself is of the form:
    public class Game implements Serializable
            public void runGame()
              //These should only run once
              if(StartGame2.runOnce)
                   welcome();          
                   makeRooms();                    
                   makePeople();
                   if(!exit && !load)
                        intro();          
                        StartGame2.runOnce = false;
                            while(!exit && !load && !save)
                                 ...doStuff...
    }Edited by: DrSpock11 on Mar 2, 2009 11:06 AM

  • CSM persistence question

    i all,
    in my balancing enviroment i need to sending multiple connection from different client to the same real server.
    there is a solution for my problem?cookie?sticky url?
    i'm very confused,it's my first configuration in this way.
    best regards
    Aghi

    Aghi,
    this is possible if there is something the CSM can use to identify the connections that have to go to the same server.
    For example, if your application can set a cookie value like server=rs1, then we can create a config based on cookie sticky to achieve what you need.
    If there is no such data to identify the server, then it doesn't seem to be possible.
    If a human can't tell us how to distinguish a connection that needs to go to server1 from another one, a machine can't do job either.
    Gilles.

  • Design Choices in a Web-only Application Using Java Persistence - Question!

    Hi,
    Is it possible to use both container and application managed entity manager factories in the same web-only application?
    It is not working for me....
    I have an application that is using container managed (injected) emf and also an application managed emf. The behavior I see is that updates from the application managed emf are not being persisted to the database but it can query properly. The container managed emf works normally.
    However, there is no error for the application managed emf. Maybe this is because I am using hypersonic in my test environment?

    Duh, forgot to joinTransaction in the app managed emf
    Edited by: edge1 on Aug 20, 2008 10:42 PM

  • EJB persistence question...

    Hi experts,
    I need to do the following operations over a table:
    1. Delete all data table.
    for example by using SQL: delete from table2. Update several rows at the same time.
    for example by using SQL: update MY_TABLE set MY_FIELD = 'New value for the column field'3. Insert several rows at the same time.
    for example by using SQL: insert into MY_TABLE select * from MY_TABLE2easiest by using SQL, but using EJBs......!!!
    I know that a EJB entity maps one row at the same time and the basic methods of the bean life cycle (create, store, remove, etc) only applies for the row mapped.
    How can I do this operations over several rows in a table using EJBs ??
    The only manner that I know is to do a loop for to iterate over each entity bean by making a findByPrimaryKey, sets bean attributes and then to wait for the ejbStore, ejbRemove, etc.
    is there another way or pattern for manage a table (several rows) in order to avoid this loop...?
    thanks in advance

    I know that a EJB entity maps one row at the same
    time and the basic methods of the bean life cycle
    (create, store, remove, etc) only applies for the row
    mapped.Exactly !
    How can I do this operations over several rows in a
    table using EJBs ?? It's not possible.
    The only manner that I know is to do a loop for to
    iterate over each entity bean by making a
    findByPrimaryKey, sets bean attributes and then to
    wait for the ejbStore, ejbRemove, etc.
    is there another way or pattern for manage a table
    (several rows) in order to avoid this loop...?No. Therefore I would advice to use SQL for those operations.
    EJB's won't work well, because of performance problems.

  • Need help please! - CMP mapping

    Hi,
    After having developped my J2EE program (with SJSE8), I would like to put it on production.
    For CMP persistence, I did deploy my program one time. Then I used SJSE8 to capture the DB Schema generated and I used it in "sun-cmp-mappings.xml" and I used "automap" for each bean.
    But now when i deploy my program, it create DB tables with a different name! So my program can't work...
    Do you know how to tell SJSE8 to use exactly the same name has the Schema?

    Correction...
    ...But now when i deploy my program, it create DB tables with different table names! So my program can't work...
    Do you know how to tell SJSE8 to use exactly the same table names has the Schema?

  • Domain Object and Service oriented pattern

    We have J2EE based application with following components, we are facing some issues with existing system.
    Current System : We have J2EE based application. The following is the flow.
    Client Layer [including JSP, Struts ] action classes  Delegates  Session fa�ade [Session bean]  DAO EJBDAO  EJB. We use CMP, xDoclets , JBOSS.
    1.     Our Domain objects are heavy. I know they are suppose to be coarse objects but they take more time in loading. Also, we noticed one thing that lot of methods are called during Domain Object creation process and it takes lot of time in loading. Actually, we dont really know what is happening as we are using CMPs.
    Question :
    -     Any input on what can be done to avoid Domain object excessive loading time.
    -     Anyone can share there experiences with Domain objects. Are you facing issues related with performance.
    -     We dont use DTO, we pass domain objects between. Do you see any problem in doing that.
    2.     Currently, our system was used by one single front end or lets say we have only one client but soon we will have more clients using it.
    Question :
    -     What should be our design approach. How can we make our system more like service oriented. If the two clients demand different business logic then how it will be handled. Business logic common to all the clients will be handled by which layer and business logic specific to client will be handles by which layer.
    -     Please suggest based on our existing infrastructure. We don�t want to use SOAP or cannot make drastic changes to our flow.
    We have domain and services in the same package and we are doing the refactoring of code, your inputs will be valuable.
    Thanks
    Sandipan

    What type of logger do you use and what is the loger-level during production?
    If it is log4j set the logger to level INFO or WARN.
    This might sound trivia but can make a difference between 20seconds and 500 ms.

  • Connection pooling and auditing on an oracle database

    Integration of a weblogic application with an oracle backend,
    Connection pooling, and auditing ,2 conflicting requirements ?
    Problem statement :
    We are in the process of maintaining a legacy client server application where
    the client is
    written in PowerBuilder and the backend is using an Oracle database.
    Almost all business logic is implemented in stored procedures on the database.
    When working in client/server mode ,1 PowerBuilder User has a one-to-one relation
    with
    a connection(session) on the oracle database.
    It is a requirement that the database administrator must see the real user connected
    to the database
    and NOT some kind of superuser, therefore in the PowerBuilder app each user connects
    to the database
    with his own username.(Each user is configured on the database via a seperate
    powerbuilder security app).
    For the PowerBuilder app all is fine and this app can maintain conversional state(setting
    and
    reading of global variables in oracle packages).
    The management is pushing for web-based application where we will be using bea
    weblogic appserver(J2EE based).
    We have build an business app which is web-based and accessing the same oracle
    backend app as
    the PowerBuilder app is doing.
    The first version of this web-based app is using a custom build connector(based
    on JCA standard and
    derived from a template provided by the weblogic integration installation).
    This custom build connector is essentially a combination of a custom realm in
    weblogic terms
    and a degraded connection pool , where each web session(browser) has a one-to-one
    relation
    with the back end database.
    The reason that this custom connector is combining the security functionality
    and the pooling
    functionality , is because each user must be authenticated against the oracle
    database(security requirement)
    and NOT against a LDAP server, and we are using a statefull backend(oracle packages)
    which would make it
    difficult to reuse connections.
    A problem that surfaced while doing heavy loadtesting with the custom connector,
    is that sometimes connections are closed and new ones made in the midst of a transaction.
    If you imagine a scenario where a session bean creates a business entity ,and
    the session bean
    calls 1 entity bean for the header and 1 entity bean for the detail, then the
    header and detail
    must be created in the same transaction AND with the same connection(there is
    a parent-child relationship
    between header and detail enforced on the back end database via Primary and Foreing
    Keys).
    We have not yet found why weblogic is closing the connection!
    A second problem that we are experincing with the custom connector, is the use
    of CMP(container managed persistence)
    within entity beans.
    The J2EE developers state that the use of CMP decreases the develoment time and
    thus also maintenance costs.
    We have not yet found a way to integrate a custom connector with the CMP persistence
    scheme !
    In order to solve our loadtesting and CMP persistence problems i was asked to
    come up with a solution
    which should not use a custom connector,but use standard connection pools from
    weblogic.
    To resolve the authentication problem on weblogic i could make a custom realm
    which connects to the
    backend database with the username and password, and if the connection is ok ,
    i could consider this
    user as authenticated in weblogic.
    That still leaves me with the problem of auditing and pooling.
    If i were to use a standard connection pool,then all transaction made in the oracle
    database
    would be done by a pool user or super user, a solution which will be rejected
    by our local security officer,
    because you can not see which real user made a transaction in the database.
    I could still use the connection pool and in the application , advise the application
    developers
    to set an oracle package variable with the real user, then on arrival of the request
    in the database,
    the logic could use this package variable to set the transaction user.
    There are still problems with this approach :
    - The administrator of the database can still not see who is connected , he will
    only see the superuser connection.
    - This scheme can not be used when you want to use CMP persistence , since it
    is weblogic who will generate the code
    to access the database.
    I thought i had a solution when oracle provided us with a connection pool known
    as OracleOCIConnectionPool
    where there is a connection made by a superuser, but where sessions are multiplexed
    over this physical pipe with the real user.
    I can not seem to properly integrate this OCI connectionpool into weblogic.
    When using this pool , and we are coming into a bean (session or entity bean)
    weblogic is wrapping
    this pool with it's own internal Datasource and giving me back a connection of
    the superuser, but not one for the real user,
    thus setting me with my back to the wall again.
    I would appreciate if anyone had experienced the same problem to share a possible
    solution with us
    in order to satisfy all requirements(security,auditing,CMP).
    Many Thanks
    Blyau Gino
    [email protected]

    Hi Blyau,
    As Joe has already provided some technical advice,
    I'll try to say something on engineering process level.
    While migrating an application from one technology to
    other, like client-server to n-tier in you case, customers and
    stakeholders want to push into the new system as many old
    requirements as possible. This approach is AKA "we must
    have ALL of the features of the old system". Mostly it happens
    because they don't know what they want. Ad little understanding
    of abilities of the new technology, and you will get a requirement
    like the one you have in you hands.
    I think "DBA must see real user" is one of those. For this
    type of requirements it can make sense to try to drop it,
    or to understand its nature and suggest alternatives. In this
    particular case it can be a system that logs user names,
    login and logout times.
    Blind copying of old features into an incompatible new architecture
    may endanger the whole project and can result in its failure.
    Hope this helps.
    Regards,
    Slava Imeshev
    "Blyau Gino" <[email protected]> wrote in message
    news:[email protected]...
    >
    Integration of a weblogic application with an oracle backend,
    Connection pooling, and auditing ,2 conflicting requirements ?
    Problem statement :
    We are in the process of maintaining a legacy client server applicationwhere
    the client is
    written in PowerBuilder and the backend is using an Oracle database.
    Almost all business logic is implemented in stored procedures on thedatabase.
    When working in client/server mode ,1 PowerBuilder User has a one-to-onerelation
    with
    a connection(session) on the oracle database.
    It is a requirement that the database administrator must see the real userconnected
    to the database
    and NOT some kind of superuser, therefore in the PowerBuilder app eachuser connects
    to the database
    with his own username.(Each user is configured on the database via aseperate
    powerbuilder security app).
    For the PowerBuilder app all is fine and this app can maintainconversional state(setting
    and
    reading of global variables in oracle packages).
    The management is pushing for web-based application where we will be usingbea
    weblogic appserver(J2EE based).
    We have build an business app which is web-based and accessing the sameoracle
    backend app as
    the PowerBuilder app is doing.
    The first version of this web-based app is using a custom buildconnector(based
    on JCA standard and
    derived from a template provided by the weblogic integrationinstallation).
    This custom build connector is essentially a combination of a custom realmin
    weblogic terms
    and a degraded connection pool , where each web session(browser) has aone-to-one
    relation
    with the back end database.
    The reason that this custom connector is combining the securityfunctionality
    and the pooling
    functionality , is because each user must be authenticated against theoracle
    database(security requirement)
    and NOT against a LDAP server, and we are using a statefull backend(oraclepackages)
    which would make it
    difficult to reuse connections.
    A problem that surfaced while doing heavy loadtesting with the customconnector,
    >
    is that sometimes connections are closed and new ones made in the midst ofa transaction.
    If you imagine a scenario where a session bean creates a business entity,and
    the session bean
    calls 1 entity bean for the header and 1 entity bean for the detail, thenthe
    header and detail
    must be created in the same transaction AND with the same connection(thereis
    a parent-child relationship
    between header and detail enforced on the back end database via Primaryand Foreing
    Keys).
    We have not yet found why weblogic is closing the connection!
    A second problem that we are experincing with the custom connector, is theuse
    of CMP(container managed persistence)
    within entity beans.
    The J2EE developers state that the use of CMP decreases the develomenttime and
    thus also maintenance costs.
    We have not yet found a way to integrate a custom connector with the CMPpersistence
    scheme !
    In order to solve our loadtesting and CMP persistence problems i was askedto
    come up with a solution
    which should not use a custom connector,but use standard connection poolsfrom
    weblogic.
    To resolve the authentication problem on weblogic i could make a customrealm
    which connects to the
    backend database with the username and password, and if the connection isok ,
    i could consider this
    user as authenticated in weblogic.
    That still leaves me with the problem of auditing and pooling.
    If i were to use a standard connection pool,then all transaction made inthe oracle
    database
    would be done by a pool user or super user, a solution which will berejected
    by our local security officer,
    because you can not see which real user made a transaction in thedatabase.
    I could still use the connection pool and in the application , advise theapplication
    developers
    to set an oracle package variable with the real user, then on arrival ofthe request
    in the database,
    the logic could use this package variable to set the transaction user.
    There are still problems with this approach :
    - The administrator of the database can still not see who is connected ,he will
    only see the superuser connection.
    - This scheme can not be used when you want to use CMP persistence , sinceit
    is weblogic who will generate the code
    to access the database.
    I thought i had a solution when oracle provided us with a connection poolknown
    as OracleOCIConnectionPool
    where there is a connection made by a superuser, but where sessions aremultiplexed
    over this physical pipe with the real user.
    I can not seem to properly integrate this OCI connectionpool intoweblogic.
    When using this pool , and we are coming into a bean (session or entitybean)
    weblogic is wrapping
    this pool with it's own internal Datasource and giving me back aconnection of
    the superuser, but not one for the real user,
    thus setting me with my back to the wall again.
    I would appreciate if anyone had experienced the same problem to share apossible
    solution with us
    in order to satisfy all requirements(security,auditing,CMP).
    Many Thanks
    Blyau Gino
    [email protected]

  • Noob Question: Problem with Persistence in First Entity Bean

    Hey folks,
    I have started with EJB3 just recently. After reading several books on the topic I finally started programming myself. I wanted to develop a little application for getting a feeling of the technology. So what I did is to create a AppClient, which calls a Stateless Session Bean. This Stateless Bean then adds an Entity to the Database. For doing this I use Netbeans 6.5 and the integrated glassfish. The problem I am facing is, that the mapping somehow doesnt work, but I have no clue why it doesn't work. I just get an EJBException.
    I would be very thankfull if you guys could help me out of this. And don't forget this is my first ejb project - i might need a very detailed answer ... I know - noobs can be a real ....
    So here is the code of the application. I have a few methods to do some extra work there, you can ignore them, there are of no use at the moment. All that is really implemented is testConnection() and testAddCompany(). The testconnection() Methode works pretty fine, but when it comes to the testAddCompany I get into problems.
    Edit:As I found out just now, there is the possibility of Netbeans to add a Facade pattern to an Entity bean. If I use this, everythings fine and it works out to be perfect, however I am still curious, why the approach without the given classes by netbeans it doesn't work.
    public class Main {
        private EntryRemote entryPoint = null;
        public static void main(String[] args) throws NamingException {
            Main main = new Main();
            main.runApplication();
        private void runApplication()throws NamingException{
            this.getContext();
            this.testConnection();
            this.testAddCompany();
            this.testAddShipmentAddress(1);
            this.testAddBillingAddress(1);
            this.testAddEmployee(1);
            this.addBankAccount(1);
        private void getContext() throws NamingException{
            InitialContext ctx = new InitialContext();
            this.entryPoint = (EntryRemote) ctx.lookup("Entry#ejb.EntryRemote");
        private void testConnection()
            System.err.println("Can Bean Entry be reached: " + entryPoint.isAlive());
        private void testAddCompany(){
            Company company = new Company();
            company.setName("JavaFreaks");
            entryPoint.addCompany(company);
            System.err.println("JavaFreaks has been placed in the db");
        }Here is the Stateless Session Bean. I added the PersistenceContext, and its also mapped in the persistence.xml file, however here the trouble starts.
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(mappedName="Entry")
    public class EntryBean implements EntryRemote {
        @PersistenceContext(unitName="PersistenceUnit") private EntityManager manager;
        public boolean isAlive() {
            return true;
        public boolean addCompany(Company company) {
            manager.persist(company);
            return true;
        public boolean addShipmentAddress(long companyId) {
            return false;
        public boolean addBillingAddress(long companyId) {
            return false;
        public boolean addEmployee(long companyId) {
            return false;
        public boolean addBankAccount(long companyId) {
            return false;
    }That you guys and gals will have a complete overview of whats really going on, here is the Entity as well.
    package ejb;
    import java.io.Serializable;
    import javax.persistence.*;
    @Entity
    @Table(name="COMPANY")
    public class Company implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        @Column(name="COMPANY_NAME")
        private String name;
        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;
            System.err.println("SUCCESS:  CompanyName SET");
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Company)) {
                return false;
            Company other = (Company) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "ejb.Company[id=" + id + "]";
    }And the persistence.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="PersistenceUnit" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/sample</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
          <property name="toplink.ddl-generation" value="create-tables"/>
        </properties>
      </persistence-unit>
    </persistence>And this is the error message
    08.06.2009 10:30:46 com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNUNG: ACC003: Ausnahmefehler bei Anwendung.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
            at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at ejb.__EntryRemote_Remote_DynamicStub.addCompany(ejb/__EntryRemote_Remote_DynamicStub.java)I spend half the night figuring out whats wrong, however I couldnt find any solution.
    If you have any idea pls let me know
    Best regards and happy coding
    Taggert
    Edited by: Taggert_77 on Jun 8, 2009 2:27 PM

    Well I don't understand this. If Netbeans created a Stateless Session Bean as a facade then it works -and it is implemented as a CMP, not as a BMP as you suggested.
    I defenitely will try you suggestion, just for curiosity and to learn the technology, however I dont have see why BMP will work and CMP won't.
    I also don't see why a stateless bean can not be a CMP. As far as I read it should not matter. Also on the link you sent me, I can't see anything related to that.
    Maybe you can help me answering these questions.
    I hope the above lines don't sound harsh. I really appreciate your input.
    Best regards
    Taggert

  • Question abou CMP EJB

    those days i read the book 'enterprise java bean'
    i got some question while reading.
    1. in CMP EJB the container will take care the connect to the database and while deployment the ejb it will create the finder methods ( and other SQL statements ) right ?
    2. in CMP EJB, where is the database? i look some deployment file, can not find any thing about database.so where is it? and how container connect the database, it use jdbc as well ?
    3. When using EJB, the client part will run ejb sever as well? i think the ejb sever part will run the sever, the client will not, right?
    thanks for answer those questions. your help will be very appreciated.
    thanks

    those days i read the book 'enterprise java bean'
    i got some question while reading.
    1. in CMP EJB the container will take care the connect
    to the database and while deployment the ejb it will
    create the finder methods ( and other SQL statements )
    right ?
    If is is BMP (Bean Managed Persistence) then you have to do it, if it has CMP (Container Managed Persistence) then the container will do it for you.
    2. in CMP EJB, where is the database? i look some
    deployment file, can not find any thing about
    database.so where is it? and how container connect the
    database, it use jdbc as well ?
    The mapping between the EJB and the database is done in a vendor specific xml file, where you map the columns of the table(s) in the database to the fields in your EJB. In that XML file you will reference the database that you will use by referencing a connection pool or datasource.
    3. When using EJB, the client part will run ejb sever
    as well? i think the ejb sever part will run the
    sever, the client will not, right?The Client part doesn't run any container. You have to create a context to the Container running the EJB and then find it and use it.
    MSB

  • To CMP or not to CMP....that is the question!

    Hey guys.
    I have a problem which I am hoping you can help me solve.
    Let's say that we are designing a simple J2EE address book web application.
    The application design must follow these requirements:
    1. The application stores all data in a relational database.
    2. The user interface to the application is browser based only.
    3. The application must be independent of the database type (Oracle, MS Sql, Informix).
    4. The application must be independent of the application server type.
    5. The application must be portable between databases and application servers.
    The application allows the user to do the following:
    A. Search for entries in the address book
    B. Display (read only) entry details
    C. Add/edit/delete entry
    Now, what I'm wondering is: Should we use CMPs to encapsulate the address book entries,
    or should we use Java classes with JDBC access to the database (managed through session beans).
    I know that if we use CMPs, we don't have to code the database access calls.
    Not only does this approach save us time, but it makes the bean portable across various database
    servers.
    But if we use CMPs, it seems to me that we face the following problem
    (please correct me if I am wrong):
    The application server creates tables in the database for storing the CMP data. The names of these
    tables are not specified by the J2EE specification (because the persistent storage does not need to
    be a relational database). Therefore if we deploy the application on application server A, and
    then later decide to change to application server B, then B might have other naming rules for tables
    than A (and would therefore be unable to read the data from the database).
    Therefore, by using CMPs, our application is no longer portable between application servers, and
    this violates design requirement number 5.
    Now, I know that many application servers allow you to specify a mapping for CMP to an existing table,
    but the configuration files for specifying these mappings are different between
    application servers. And since we do not want our application to have to know anything about the
    server it is to be deployed on, that solution is unacceptable.
    Another way would be to implement the address book without CMPs, using Java classes with JDBC access
    to the database (caching frequently accessed data, perhaps with the A.C.E. Smart Cache pattern).
    My question is: What exactly is the tradeoff between these two implementations (in this limited web
    access only context)?
    Will the non-CMP implementation come in second in performance (and if so, why?)?
    When the application server tier is clustered, does the application server synchronize the cached
    CMP data in the cluster? This will have to be done manually in the non-CMP implementation.
    Any thoughts on the above issues are greatly appreciated.
    Thanks.
    OGG.

    I entirely agree! I think this is a general problem with java going forward that they didn't think about. Look for my post on problems with JAAS with JavaBeans and EJBs. They have not thought enough about how to truly ensure integration and portability of 3rd party tools. Yes, in this regard M$ is a little better, as their ActiveX integration has produced a pretty rich 3rd party industry, but that's helped by the fact that they don't really worry about security. (Although their COM+ security integration for 3rd party tools is better than JAAS with Java. In COM+, I can take your component and actually set security levels/roles for any method within your component! You can't do that in JAAS - see the JAAS Problems and Misconceptions discussion somewhere in the Java Forums).

  • Question about weblogic-cmp-rdbms-jar.xml

    WinNT 4.0 SP6, Weblogic 5.10
    In the online documents, it says:
    ---- digest from the online documents ----
    The following example finds all the EJBs in a table. It uses the
    sample finder method signature:
    public Enumeration findAllAccounts()
    throws FinderException, RemoteException
    The sample <finder> stanza uses an empty WLQL string:
    <finder>
    <method-name>findAllAccounts</method-name>
    <finder-query></finder-query>
    </finder>
    ---- End of digest ----
    However I implement it in my sample EJB, call findAllAccounts in the
    client JSP file, get a SQLException about "null after where".
    How can i solve this problem?
    Thanks in advance,
    Paul Shen
    Email: [email protected]
    WWW: shensr.8m.com

    In the DOCTYPE declaration, replace "weblogic-cmp-rdbms-jar" with
    "weblogic-rdbms-jar".
    Bob
    "Jason" <[email protected]> wrote in message
    news:[email protected]..
    >
    When I deploy my bean I get the following error:
    While reading META-INF/weblogic-cmp-rdbms-jar.xml, the EntityEJB's pers
    istence layer failed to deploy. The error was:
    Error in descriptor line 7: Document root element "weblogic-rdbms-jar",must ma
    tch DOCTYPE root "weblogic-cmp-rdbms-jar".
    atweblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:302)
    >
    >
    Here is my deployment descriptor: (weblogic-cmp-rdbms-jar.xml)
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-cmp-rdbms-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'
    >
    >
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>MessageEJB</ejb-name>
    <data-source-name>ora8lplxPoolDataSource</data-source-name>
    <table-name>Messages</table-name>
    <field-map>
    <cmp-field>msg_id</cmp-field>
    <dbms-column>msg_id</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>msg</cmp-field>
    <dbms-column>msg</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>msg_date</cmp-field>
    <dbms-column>msg_date</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    </weblogic-rdbms-jar>

  • Newbie question on Java Persistence API - Entity Beans

    Hi All,
    I am basically new to Entities and the Java Persistence API. My question is, when using a container managed EntityManager, do I have to manually tidy-up any resources? Say for example, do I have to explicitly close the database connection (if ever I have that ability)? Invoke close() on EntityManager?
    - Pat

    You don't have to. That's what they mean by container managed. The container does it for you.
    In fact you will get an IllegalStateException if you call close on a container-managed EntityManager.

Maybe you are looking for

  • How to start OC4J as a Windows service?

    I installed OC4J standalone version 10.1.3.4.0 so I can configure Apache FOP. The startup/shutdown process is manual and my Windows customers are not liking it at all. Is there a way to make it a Windows service so it starts automatically when the sy

  • Lightroom CC starts once, but fails on second time

    After resolving the "Start" problem fixed by "Log off/Log in" in Create Cloud, I finally be able to try Lightroom CC. But when I quit Lightroom, and restart it a second time, it crashes : If a remove the "catalog" on file system, ligtroom starts agai

  • Billing information verification problem, it is charging my account but not working

    I just got an IPhone 4s. Attempting to download the app facebook I was forced to verify my payment information. I entered my information, correctly I may add, and it said it did not match my bank's records. So I called my bank, and called Apple and n

  • Open the WebDB 3.0 private forum to the general public

    A lot of traffic on this forum is off topic. I would encourage Oracle to move the Private WebDB 3.0 forum to a public forum renamed to Oracle Portal. The private WebDB 3.0 forum does not really get a lot of traffic anyway. Jeff Dalgliesh null

  • I cannot access the gsm network

    The iphone states that the network is unavailable but at the same time I have good connection on my ipad (same provider). How can I solve this?