"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 <-
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".