Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Call to BMT from CMT Questions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I had few Questions as below. Assume that the CMT has default transaction type defined as 'REQUIRED' and that all the invocations are with the same session context as of the calling method Bean.

1. If the transaction is defined to be managed by Bean and we don't actually put any begin and commit/rollback in the method of that bean, how would the system handle this situation? If there are 10 different updates being made in the method and there is no transaction initiated in the method, when would the changes for each update actually reflect in database. When would they be committed? Would it be kind of auto-commit mode?

2. If a call is made from a method in CMT Bean to another method in BMT Bean, the container handled transaction would be suspended. So, now the Question is that if the 2nd called method tries to acquire an Exclusive lock on a row of a table that is already locked by the suspended transaction, would the system not allow it to take the lock or would it allow? The 2 transactions are under same session context.

3. If a method is invoked in a CMT Bean (the Bean extends another CMT Bean). And the super class is invoked from this method. So, when the control goes to the method in the super class, does it keep the same transaction that was initiated in the original method by the Container or does it initiate another transaction?

Thanks in Advance!
 
Dhiraj Kumar Gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Can someone please help in answering these Questions. I have tried to search but I didn't get answers to these anywhere.

Thanks & Reards,
Dhiraj
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic