5 Replies Latest reply on Dec 31, 2002 10:41 AM by adrian.brock

    INSERTING AN ALREADY EXISTING BEAN

    moeljo

      Hi all

      I meet a problem when reinserting a data after remove it. It always produce an "INSERTING AN ALREADY EXISTING BEAN" error


      I use CMP 1.0 and Stateless session bean. First I insert a record in DB by calling a method in SB that call an EntityBean's create method. After that I remove that record by calling a SB method that call a EB's remove method. Then I want to inserting the same record (the same PK) to the database using the first task. But it always generate an error, INSERTING AN ALREADY EXISTING BEAN"
      Is there anyone that ever meet this problem and have a solution to this problem? Please help me.

      I've tried to use commit option C but the problem is still exist

      Thanks

        • 1. Re: INSERTING AN ALREADY EXISTING BEAN
          moeljo

          Hi all

          I meet a problem when reinserting a data after remove it. It always produce an "INSERTING AN ALREADY EXISTING BEAN" error


          I use CMP 1.0 and Stateless session bean. First I insert a record in DB by calling a method in SB that call an EntityBean's create method. After that I remove that record by calling a SB method that call a EB's remove method. Then I want to inserting the same record (the same PK) to the database using the first task. But it always generate an error, INSERTING AN ALREADY EXISTING BEAN"
          Is there anyone that ever meet this problem and have a solution to this problem? Please help me.

          I've tried to use commit option C but the problem is still exist

          Thanks

          • 2. Re: INSERTING AN ALREADY EXISTING BEAN

            Can you try it with 3.0.5RC1 from CVS

            There is a fix in that version for a similar
            problem.

            Regards,
            Adrian

            • 3. Re: INSERTING AN ALREADY EXISTING BEAN
              moeljo

              Thanks for your reply Adrian, Is this a bug from JBoss? I've met this problem since I use JBoss 2.2.2.

              How can I get this 3.0.5RC1 version?

              Regards,

              Harry

              • 4. Re: INSERTING AN ALREADY EXISTING BEAN
                moeljo

                Use Jboss 3.0.5 doesn't fix my problem ... Do anyone there have an idea?

                • 5. Re: INSERTING AN ALREADY EXISTING BEAN

                  Can you post a simple example that
                  reproduces the problem?

                  Regards,
                  Adrian