-
1. Re: newbie question: transaction (CMT)
cvandyck Apr 5, 2004 5:40 PM (in response to jchang)* I have declared my finder methods in an entity bean to have transaction type "NotSupported". But I read in the ejb 2.0 spec that they strongly advise us to use only the "Required", "RequiresNew" and "Mandatory" in entity beans. Why would I want to create transactions for methods that only find data in the database. And again, If I dont' put any transaction type in an entity bean method, how JBoss treats them by default?.
If your finder methods use on-find read-ahead, then the read-ahead cache is only valid for the lifetime of the transaction in which the finder was invoked. By not having a transactional context in which you use the beans you get back from the finder method, you will incur extra db time overhead.
* Are private methods inside session beans considered part of a transaction. In other words, Does JBoss creates a transaction when a private method is use in a session bean.
If the business method of your session bean is marked to use a transaction, then any private methods that that method calls will execute under the current transactional context.