• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

In CMT when does a transaction actually commit

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

In CMT when does the transaction actually commit. Is it when the business method completes or
does it depend upon the deployment descriptor <trans-attribute> tag.
If that is the case when will the transaction actually commit
if we have
Required
RequiredNew
Mandatory
Rgrds
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For all transaction attributes necessitating a valid transaction context (Required, RequiresNew and Mandatory), "The Container attempts to commit the transaction when the business method has completed. The container performs the commit protocol before the method result is sent to the client." (EJB 2.0 spec, Sections 17.6.2.2, 17.6.2.4, 17.6.2.5)
I hope it helps
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 3901
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic