alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Glassfish example source code file (README)

This example Glassfish source code file (README) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Glassfish tags/keywords

customer_rb1, customer_rb1, ejb, ejb, here, required, servlet, servlet, table, this, this, transaction, tx_attribute, usertransaction

The Glassfish README source code

This tests the rollback logic of transaction. An EJB webservice is invoked by a servlet. This webservice method uses REQUIRED TX_Attribute. 

Here is the flow-

1. Standalone client invokes a servlet
2. Servlet creates table CUSTOMER_rb1 
3. Servlet starts a UserTransaction
4. Servlet adds a row in the CUSTOMER_rb1 table
5. Servlet calls the EJB webservice
6. EJB webservice adds a row in the CUSTOMER_rb1 table
7. Transaction is rolledback using SessionContext.setRollbackOnly()
8. Servlet rollback the transaction
9. It is checked that the data is not updated in the table.
10. Table CUSTOMER_rb1 is dropped

Other Glassfish examples (source code examples)

Here is a short list of links related to this Glassfish README source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.