Discussion:
can't find the bean which was just created??
(too old to reply)
Baba Baba
2005-02-14 18:43:35 UTC
Permalink
Hi all.

I am completely stuck at this problem. I'll try to explain it as briefly as possible. (Btw I use Weblogic 8.1 and Oracle 10g DB).

I create an entity bean (it has a String as a primary key). It has some relationships, everything is set up nicely. Upon creation I put the Id in a JMS message, the message in a JMS queue and finish the method.

From the MDB that gets this message I do findByPrimaryKey(id) and it complains it cannot find my bean. Why? I can see it in the database. Also if I send to the MDB an ID from a bean that was created earlier, it works. It just can't find the bean that was just created, as if it wasn't "commited".

What could be the cause of this? Is there an easy way to explain/solve it?

I appreciate any kind of help. Thanks in advance. Cheers!
Rob Woollen
2005-02-15 16:46:03 UTC
Permalink
Does the database insertion and the JMS publish occur in the same XA
transaction? It sounds like the JMS commit happens (sometimes) quick
enough that the other resource (the database) has not finished commit
processing yet. So you don't find your key.

-- Rob
Post by Baba Baba
Hi all.
I am completely stuck at this problem. I'll try to explain it as briefly as possible. (Btw I use Weblogic 8.1 and Oracle 10g DB).
I create an entity bean (it has a String as a primary key). It has some relationships, everything is set up nicely. Upon creation I put the Id in a JMS message, the message in a JMS queue and finish the method.
From the MDB that gets this message I do findByPrimaryKey(id) and it complains it cannot find my bean. Why? I can see it in the database. Also if I send to the MDB an ID from a bean that was created earlier, it works. It just can't find the bean that was just created, as if it wasn't "commited".
What could be the cause of this? Is there an easy way to explain/solve it?
I appreciate any kind of help. Thanks in advance. Cheers!
Loading...