This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am working on an application where I have 2 DAOs:
CustomerDAO and SubscriptionDAO. I am using pure JDBC within those daos. A manager SLSB creates and call CRUD methods on these DAOs.
In the scenario, whenever a new Customer is created, I need to create a Subscription automatically. (giving the customer id to the subscription)
I do this like this:
I wonder how can I include transactional capabilities to this code. (If I use Tomcat alone, or Tomcat with an AS I havent decided yet).
That is to say, if theres a problem in the subscription insert section, customerdao.insert should be rollbacked.