Skip to Main Content
Enterprise JavaBeans, Fourth Edition
book

Enterprise JavaBeans, Fourth Edition

by Sacha Labourey, Bill Burke, Richard Monson-Haefel
June 2004
Intermediate to advanced content levelIntermediate to advanced
792 pages
23h 17m
English
O'Reilly Media, Inc.
Content preview from Enterprise JavaBeans, Fourth Edition

Transactions

When a bean calls createTimer( ), the operation is performed in the scope of the current transaction. If the transaction rolls back, the timer is undone: it’s not created (or, more precisely, uncreated). For example, if the Ship EJB’s scheduleMaintenance( ) method has a transaction attribute of RequiresNew, a new transaction will be created when the method is called. If an exception is thrown by the method, the transaction rolls back and the new timer event is not created.

In most cases, the ejbTimeout( ) method on beans should have a transaction attribute of RequiresNew. This ensures that the work performed by the ejbTimeout( ) method is in the scope of container-initiated transactions. Transactions are covered in more detail in Chapter 16.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Enterprise JavaBeans, Third Edition

Enterprise JavaBeans, Third Edition

Richard Monson-Haefel
Enterprise JavaBeans 3.1, 6th Edition

Enterprise JavaBeans 3.1, 6th Edition

Andrew Lee Rubinger, Bill Burke
Enterprise JavaBeans 3.0, 5th Edition

Enterprise JavaBeans 3.0, 5th Edition

Richard Monson-Haefel, Bill Burke

Publisher Resources

ISBN: 059600530XSupplemental ContentCatalog PageErrata