Originally posted by Hideki Mae:
I have a question regarding CMT and transactions. I use JBoss-3.2.4 with Oracle 9i. My question is how long does it take for the databse to get updated when you use CMT? I used CMT for my web project and I noticed that it can take a long time (~30 minutes to ~50 minutes) before the transaction that was executed by the CMT gets reflected on the Oracle database. Is there some configuration setting that I can change to make the database get updated faster (preferrably within a minute).
The codes execute correctly and I don't see anything in the server.log that indicates an error. It just takes a long time for the database to get updated. My web page has a table that will display the contents of my bean and it does show the newly added information.
Thanks in advance for any help you can give me.
That's actually a JBoss-specific problem (better to say 'feature'), it does not always update DB (don't synchronize CMP-DB) for the reason of saving resources.
Try to play with commit options A, B, C, D in standardjboss.xml (or jboss.xml in your EJB jar):
Commit-option A, this bean is cached and is available between transactions. Normally this assumes that any database access is done through the container.
Commit-option B, this is
JBoss' default and is also known as pessimistic locking. The bean is locked in a transaction until the transaction commits or rolls back. This is true for read-only transactions as well.
Commit-option C, the bean passivates at the end of a transaction and is locked during a transaction.
Commit-option D, a background
thread periodically executes ejbLoad() on beans in the cache and this option is the same as commit-option A otherwise.
regards,
MZ