The ejbCreate method or postCreate of Documento must insure that all the beans
properties are set.

There is no need for the container to call ejbFindByPrimaryKey if the bean is
already in the container's cache. And if you're using commit option A the
container will not call ejbLoad in your example.

--Victor


Rafael Alves Chaves wrote:

> Hi,
>
>   I'm having a strange problem with entity beans in JBoss. For debugging
> purposes, I have instrumented ALL callback and business  methods to
> generate an output identifying the called method and, when useful, its
> arguments.
>
>   Below is the trace generated after two different clients are executed.
> The first creates a session bean, and through this session bean, creates
> an entity bean. The second client just searches for the created entity,
> and outputs its properties to the screen.
>
> The first client creates a stateful session bean (ObjetoSistema):
>
> [ObjetoSistema] ObjetoSistemaBean.setSessionContext(<context>)
> [ObjetoSistema] ObjetoSistemaBean.ejbCreate(1000,2)
>
> The same client calls some methods:
>
> [ObjetoSistema] ObjetoSistema.addDocumento("Teste-1000-0.txt",<conteudo>)
>
> To finish, the client will "commit" the session bean, calling
> "persiste()", which creates a new entity bean (Documento), which is BMP:
>
> [ObjetoSistema] ObjetoSistema.persiste()
> [Documento] DocumentoBean.ejbCreate(1000,2,"Teste-1000-0.txt","2/A/1000")
> [Documento] DocumentoBean.ejbPostCreate(1000,2,"Teste-1000-0.txt","2/A/1000")
>
> The client then finishes the session object:
>
> [ObjetoSistema] ObjetoSistemaBean.ejbRemove()
>
> Now the strange things: The second client calls
> DocumentoHome.findByPrimaryKey, but the bean class
> DocumentoBean.ejbFindByPrimaryKey doesn't get called, although the client
> receives a reference to the found bean. The problem is that all properties
> of this bean are null, and this null values are automatically synchronized
> on the database when the client calls the acessor methods:
>
> [Documento] DocumentoBean.setEntityContext()
> [Documento] DocumentoBean.getNome ()
> [Documento] DocumentoBean.ejbStore ()
> [Documento] DocumentoBean.getCaminho ()
> [Documento] DocumentoBean.ejbStore ()
>
> Does anyone has any idea about this behaviour? I'm using JBoss 2.2.1.
>
> Thanks for any clue...
>
>     Rafael
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to