Sun GlassFish Enterprise Server v2.1.1 Performance Tuning Guide

Use Lowest Cost Database Locking

Use the lowest cost locking available from the database that is consistent with any transaction. Commit the data after the transaction completes rather than after each method call.