Simon,
What is not normal for me is that the line "4.FIND/READ done" is printed. I
expect here an Exception.
Instead, I got the Exception on remote.getPk().
The Exception thrown in AuthBMPBean is because I manually throw EJBException
when I have not (SQL) ResultSet in the SQL "SELECT" statement. This is a
change in what I explain the first time (where I got a SQLException).
I copy paste the test program and the results.
I send the EJB in an attachement to your private address.
Thanks for your help.
Vincent.
The Test Program
try {
AuthDOHome home=getAuthHome();
System.out.println("Home Interface="+home);
AuthDetail authDetail=new AuthDetail();
authDetail.setzzz . . . .
AuthDO remote=home.create(authDetail);
System.out.println("1.CREATE done "+remote);
GeneralPK pk=remote.getPk();
home=getAuthHome();
com.hm.base.domain.AuthCMPHome
home2=(com.hm.base.domain.AuthCMPHome)home;
com.hm.base.domain.AuthCMP remote2=home2.findByPrimaryKey(pk);
System.out.println("2.FIND/READ done "+remote2);
((com.hm.base.domain.AuthCMP)remote).remove();
System.out.println("3.DELETE done ");
remote=null;
remote=((com.hm.base.domain.AuthCMPHome)home).findByPrimaryKey(pk);
System.out.println("4.FIND/READ done "+remote);
System.out.println("5.FIND/READ done "+remote.getPk());
} catch (Exception e) {
System.out.println("Exception");
e.printStackTrace();
}
The result on the Client Side :
Home Interface=AuthHome
1.CREATE done Auth:22220f:e3afb2dfa9:-8000
2.FIND/READ done Auth:22220f:e3afb2dfa9:-8000
3.DELETE done
4.FIND/READ done Auth:22220f:e3afb2dfa9:-8000
Exception
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
javax.transaction.TransactionRolledbackException: Object not found.;
nested exception is:
javax.ejb.EJBException: Object not found.
javax.transaction.TransactionRolledbackException: Object not found.; nested
exception is:
javax.ejb.EJBException: Object not found.
javax.ejb.EJBException: Object not found.
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:16
9)
at $Proxy1.getPk(Unknown Source)
at com.hm.base.factory.DomainFactory.main(DomainFactory.java:186)
The result on the server side
[Default] JBoss PRE-2.1 Started
0 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing setEntityContext
0 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbCreate
10 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing getConnection
10 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - SQL=INSERT INTO AUTHORIZATION ( pk,
actionpk, orgpk, pr
120 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.GeneralPersistentDO - Executing getPk
130 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbPostCreate
210 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.GeneralPersistentDO - Executing getPk
210 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbStore
210 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing getConnection
210 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - SQL=UPDATE AUTHORIZATION SET actionpk
= ?, orgpk = ?, p
251 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing setEntityContext
271 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbRemove
271 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing getConnection
271 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - SQL=DELETE FROM AUTHORIZATION WHERE pk
= ? 22220f:e3afb
291 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbActivate
291 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing ejbLoad
301 DEBUG [RMI TCP Connection(12)-192.168.0.1]
com.hm.base.domain.AuthCMPBean - Executing getConnection
[Auth] TRANSACTION ROLLBACK EXCEPTION:Object not found.; nested exception
is:
javax.ejb.EJBException: Object not found.
[Auth] javax.ejb.EJBException: Object not found.
[Auth] at com.hm.base.domain.AuthBMPBean.ejbLoad(AuthBMPBean.java:135)
[Auth] at java.lang.reflect.Method.invoke(Native Method)
[Auth] at
org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPersistenceManager
.java:299)
[Auth] at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchron
izationInterceptor.java:192)
[Auth] at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce
ptor.java:187)
[Auth] at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[Auth] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:263)
[Auth] at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[Auth] at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:14
4)
[Auth] at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[Auth] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:323)
[Auth] at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:367)
[Auth] at java.lang.reflect.Method.invoke(Native Method)
[Auth] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
[Auth] at sun.rmi.transport.Transport$1.run(Transport.java:142)
[Auth] at java.security.AccessController.doPrivileged(Native Method)
[Auth] at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
[Auth] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
[Auth] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
43)
[Auth] at java.lang.Thread.run(Thread.java:484)
-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]De la part de Bordet, Simone
Envoy� : mardi 26 d�cembre 2000 23:19
� : 'jBoss'
Objet : RE: [jBoss-User] ejbFindByPrimaryKey not read in version PRE2.1
Hey Vincent,
I tried what you suggest, ie:
1) create
2) fbpk
3) remove
4) fbpk
and I always get ObjectNotFoundException, correctly as expected.
Can you send me your test code and details (DB, CMP or BMP, ejb-jar.xml,
jboss.xml, etc), so I'll try it out ?
Thanks,
Simon
> Rickard,
> OK...
> But Sorry I forgot one piece in my test, I create, then
> fbpk, then remove,
> then fbpk, then getPropX() on the remote interface. I
> took the time to
> analyze, here whar happens.
> What happen is that
> - after the second fbpk, on the server I have
> nothing that happen an I
> receive no error (bug)
> - after I cal getPropX() on the remote, on the
> server, I have
> - ejbActivate
> - ejbLoad
> This ejbLoad have SQL read from the db
> on a record that does not
> exist, so
> SQLException so I receive a java.rmi.UnmarshallException.
>
> On version 2.0, I do not have these 2 calls but instead
> directly ejbFbpk
> that throw the Objectnfe (FinderException) up to my client.
>
> Vincent.
>
> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]De la part de
> Rickard �berg
> Envoy� : mercredi 20 d�cembre 2000 17:12
> � : jBoss
> Objet : Re: [jBoss-User] ejbFindByPrimaryKey not read
> in version PRE2.1
>
>
> Vincent Harcq wrote:
> > In a test where I create then just findByPrimaryKey
> after, ejbFind
> > ByPrimaryKey is not read in jBoss PRE2.1 from CVS.
> > It works OK when deployed on 2.0.
>
> This is ok. If the bean wanted by the fBPK call is
> active we know that
> it exists, and thus return an EJBObject to it without
> calling the eFBPK
> on an instance.
>
> /Rickard
>
> --
> Rickard �berg
>
> Email: [EMAIL PROTECTED]
>
>
> --
>
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]