0 Replies Latest reply on Mar 12, 2003 5:52 AM by Soni

    Primary key value goes null in BMP

    Soni Newbie

      Hi all,
      I am trying an BMP example having datasource as PostgreSQL. I am trying a sample of "Account". In the Bean side i have methods for create, deposit, withdraw, fineByPrimaryKey, findByOwnerName and other remaining. And at the client side if i try to update the DB by using,
      1. findByPrimaryKey for getting a row
      2. then doing deposit(int)
      its not working...
      for debuging purpose i am printing the primary Key at server side.
      but for my surprise its printing 'null' for every print.
      Then i printed balance at server side.
      the value of balance is updated but not inserted into DB.
      and so i tried with
      1. fineByOwnerName for getting row
      2. changed the bean ejbStore() to update row depending on ownerName( not primaryKey id )
      3. then called deposit from client
      for my surprise it updates the value to db....

      And one more thing i found,
      while debudding, i found 'setEntityContext' is called for findByPrimaryKey() and also for deposit().
      Is this is the problem?

      how to get a solution for this?

      i am trying the sample given in 'Mastering Enterprise JavaBeans' by Ed Roman.

      how can i get the solution for this?
      Is it the behaviour of Jboss?
      i am using jboss-3.0.4

      thx in advance,
      Soni.