Problem in EntityBean


General J2EE: Problem in EntityBean

  1. Problem in EntityBean (5 messages)

    Hello All, i have develop a simple Entity, from Mastring_EJB2 by theserverside....

    it is the very first example of entity bean what i am getting wrong when i change the client side code and use only findByPrimaryKey method to get a refference of remote interface...
    Account home=null;

    account=home.findByPrimaryKey(new AccountPK("1234-456-789"));
    account.getBalance(); //it will give the right output that is 100.
    now when i call the deposit method on it like
    it will give me the right output i-e 600 but record in the DB is not updated, when i see the output which is debugged on server side the ejbStore() gives the followin output

    22:59:36,351 INFO [STDOUT] ejbStore() Called
    22:59:36,351 INFO [STDOUT] Raheel 100.0 null

    the third value that is null is the primary key, i don't no why it is shows null because i have the refference of remote interface when i call the ejbFindByPrimaryKey and when i query to get the OwnerName() after getting the refference it will give me a accurate result and also when deposit() method called it did the right thing by adding 500 but it add only in the entity bean instance not updated in the database....

    any help will be great full.

    with best regards.. and thanks in advacne...

    Threaded Messages (5)

  2. Problem in EntityBean[ Go to top ]

    What kind of entity bean is it?

    CMP or BMP
  3. BMP it is[ Go to top ]

    Hi, the bean i made is BMP on Jboss 3.2.1 and mysql 3.23.46-nt

  4. BMP it is[ Go to top ]

    Just checking... You did write the SQL to store the bean in the database?
  5. The other thing[ Go to top ]

    The other thing i notice that untill and unless container is running it shows the updated balance but record is not updated in the database table i am very much stuck because of that....

    with best regards...
  6. The other thing[ Go to top ]

    From your reply I believe your ejbStore has some problem. Check your SQL query