|Here is my problem.  if i actually borrow a book, and change it's status
|from UnBorrowed to borrowed(all through calling methods of the Book bean) ,
|when i call FindBorrowed, the Enumeration of books returned does
|contain the
|newly borrowed book, but when i call getStatus on the newly borrowed book,
|the status returned is 'Unborrowed'.
|
|As well, if a borrowed book is returned, it shows up in the unborrowed list
|of books, but it's status is still 'borrowed'.
|
|the behaviour seems to suggest that the query from the database returns the
|list of books, and when JBoss is creating the Enumeration, it somehow uses
|cached books to construct it, and doesn't update all the information in
|those cached books. ???

hmmm this is strange.

Here is how the Enumeration works.
BTW I BELIEVE YOU ARE USING CMP ???? (please specify ;()

In fact jboss runs the query on the database (find borrowed) so it seems
that the database is correctly updated with the "borrowed" field set to
true.  This means that the field is set to true in the bean as well
otherwise it wouldn't show in the DB at all, since in CMP the db is a
reflection of the fields.  In other words, if the state in the db is
"borrowed" it means the state in the instance in cache is "borrowed" (IN
CMP).

The beans you recieve from the FIND are just "proxies" they are just empty
shells with the identifier of the book cachekey and only when you call a
business method (getStatus) does it go to the server and look at the field
to return it.  Again at this stage, the status should be "borrowed".

Do me a favor...
1- tell me if this is CMP or not
2- call borrow on a book and call getStatus right after...

you should see the same mistake considering 1 is true.

If you are BMP then it is another problem.

|Description of Problem #2.
|
|That's not all, i also have a strange problem with the jaws stuff. i
|understand that tuned-update is supposed to be an optimization so
|that if it
|is set to true, only the changed data is written out.  My understanding is
|that if you set tuned-update to false, everything should be written all the
|time.  however, in my experience, when i set tuned-update to false, nothing
|gets writted to the database at all.  this is very puzzling.
|i am currently running jboss beta2 (downloaded the binaries off the jboss
|site).

No, tuned updates just means that when the stuff gets written we only update
the fields that have changed.

The decision to commit is dependent on the transaction most of time (if you
commit a transaction it will be written) then it looks at what fields have
changed and commits these accordingly, they are 2 orthogonal decisions.

|One last thing i would like to point out, i realize that one could claim
|that the caching problem could be in other areas of this application i am
|writing, but in our experience, the other components do work correctly when
|we used wls to deploy the ejb.  the only part we have changed is
|that we now
|use JBoss to deploy the ejb and make the connection to the database.
|
|I hope this post of mine makes sense.
|
|i'd appreciate any help i can get. has anyone else ever experienced strange
|problems like this?

well no, this is a new one to me, and the testbean suite does something like
what you described and it works.

marc

|
|Kevin Lo.
|
|
|


Reply via email to