Hi, I am using jonas 2.1 output of jonas when started: JOnAS Server, version 2.1, running on rmi. The architecture is as follows: The client contacts a session bean called dispatcher which in turn works with the entity bean. Therefore I have 2 deployment-descriptors. The transaction attributes are always "Required". I tried "Required" for the session bean and "Supports" for the entity bean with the same effect. The problem did not occur with jonas 1.6. Some days I downloaded jonas 2.1 and adapted the beans to the new jonas. By the way I tried it with jonas 2.0 and the problem occured there as well. -----Urspr�ngliche Nachricht----- Von: Philippe Durieux [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 12. Oktober 2000 09:46 An: Blumreiter, Fa. Westernacher, IIPS, B Cc: '[EMAIL PROTECTED]' Betreff: Re: Changes in Entity Bean not saved "Blumreiter, Fa. Westernacher, IIPS, B" wrote: > > Hello, > > I have got a peculiar problem: I am trying to save an attribute to a containermanaged entity bean. > It works fine. But if I try to get another reference to exactly the same bean by a findByPrimaryKey-method the changes are not saved in the database. > > My code looks as follows: > 1 Sachkonto sk, sk2 = null; > 2 SachkontoBeanPK skpk = new SachkontoBeanPK( Long.parseLong( sKey ) ); > 3 sk = skHome.findByPrimaryKey( skpk ); > 4 System.out.println("before update " + sk.getDef() ); > 5 System.out.println("before update " + sk.getId() ); > 6 sk.setNr(nr); > 7 sk.setText(text); > 8 sk.setBez(bez); > 9 sk.setGesperrt(gesperrt); > 10 sk.setDef(def); > 11 System.out.println("after update " + sk.getDef() ); > 12 System.out.println("after update " + sk.getId() ); > 13 sk2 = skHome.findByPrimaryKey( skpk ); > 14 System.out.println("after update " + sk2.getDef() ); > 15 System.out.println("after update " + sk2.getId() ); > > the output looks as follows: > > before update true > before update 150000063 > after update false > after update 150000063 > after update true > after update 150000063 > > The same output comes if I modifies the codse as follows: > 1 Sachkonto sk = null; > 2 SachkontoBeanPK skpk = new SachkontoBeanPK( Long.parseLong( sKey ) ); > 3 sk = skHome.findByPrimaryKey( skpk ); > 4 System.out.println("before update " + sk.getDef() ); > 5 System.out.println("before update " + sk.getId() ); > 6 sk.setNr(nr); > 7 sk.setText(text); > 8 sk.setBez(bez); > 9 sk.setGesperrt(gesperrt); > 10 sk.setDef(def); > 11 System.out.println("after update " + sk.getDef() ); > 12 System.out.println("after update " + sk.getId() ); > 13 sk = skHome.findByPrimaryKey( skpk ); > 14 System.out.println("after update " + sk.getDef() ); > 15 System.out.println("after update " + sk.getId() ); > > The change are not saved to the database. > > If I delete line 13 - 15 everything works fine. > > Has anyone encountered this problem? > > Answers will be appreciated... > Thanks a lot in advance Hi, This seems to be an interesting problem. Can you tell me which jonas version you are using and what are the transactional attributes of your methods? (you can send me the .xml file - assembly-descriptor part) Thanks. -- Philippe Durieux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bull - 1 rue de Provence - 38432 Echirolles Cedex France [EMAIL PROTECTED] -> Download our EJBServer at http://www.evidian.com/ejb <-
AW: Changes in Entity Bean not saved
Blumreiter, Fa. Westernacher, IIPS, B Thu, 12 Oct 2000 00:58:11 -0700
- Re: AW: Changes in Entity Bean not s... Blumreiter, Fa. Westernacher, IIPS, B
- Re: AW: Changes in Entity Bean ... Philippe Durieux
ejb-jar.xml