Hi
Do you define your own Primary Key class ?
If so, how does the equals method look ?
-thorick
This is a discussion on Finder not find updated ejbs in WLS70 - Weblogic ; Hi! I have an EJB "A". When I find with a finder and the entity has been modified, the finder look by a modified field and doesn't find the ejb. I set include-updates to true but this not work. I ...
Hi!
I have an EJB "A". When I find with a finder and the entity has been modified,
the finder look by a modified field and doesn't find the ejb. I set include-updates
to true but this not work. I have WLS70 sp4 on Win and Linux against oracle 9.2.
The configuration is by default, except include updates set to true in the finder
I use.
The test i performed is this:
(The ejb is "A")
AServerLocalHome AHome = ctx.lookup (...);
Collection c1 = AHome.findByXYZ(, , );
if (c1.size() > 0) {
Iterator it = c1.iterator();
AServerLocal aLocal = (AServerLocal)it.next();
aLocal.setX();
Collection c2 = aHome.findByXYZ(, , );
if (c2.size() > 0) {
Iterator it = c2.iterator();
while (it.hasNext()){
AServerLocal aLocal2 = (AServerLocal)it.next();
if (aLocal2.getPK().equals(aLocal.getPK())) {
System.out.println ("I find it");
}
}
}
}
All in the same transaction. But the change made in the ejb is not visible to
the finder.
So, if in a transaction a change made is not visible to the transaction, the concept
of "transaction" dissapears?
Hi
Do you define your own Primary Key class ?
If so, how does the equals method look ?
-thorick
Mi Primary Key class is JBuilder 7 default, java.math.BigDecimal.
The finder look for three fields, not for the primary key. One of the fields has
been modified in the same transaction and the finder don't find the ejb with the
new value.
What transaction attributes are set for the finder methods? Is all of the
code
running in the same transaction?
Seth
"Lucas"wrote in message
news:40347569$1@newsgroups.bea.com...
>
> Mi Primary Key class is JBuilder 7 default, java.math.BigDecimal.
>
> The finder look for three fields, not for the primary key. One of the
fields has
> been modified in the same transaction and the finder don't find the ejb
with the
> new value.
All code is in the same transaction.
- Transaction attributes are by defaults (transaction required).
- Finder attributes are by defaults, excepts:
include-updates = True
- EJB attributes are by default, excepts:
delay-database-insert-until=ejbCreate
cache-between-transactions=True
Concurrency strategic is default (Database, Oracle 9i2)
include-updates=True, so all changes made to all ejb involved in current transaction
are persisted to DB before performing the finder,
so, the finder may find the ejb whose field (field1) was modified and is tested
in the finder (where field1 = ?1 ...), but it not works.
What is the problem???
I can't think that a change made in a transaction is not visible to transaction,
because a lot of algorithms in the business logic made changes and then find by
the changes, so is a little problem for my application.
I change the attribute delay-updates-until-end-of-tx to true and the finder works,
by some findByPrimaryKey not work still.