createRandomOption ( sp . getSymbol , sp . getDate ());
em . persist ( sop );
curDate . setTime ( curDate . getTime () + msPerDay );
txn . commit ();
em . close ();
Similar to what was observed using transactions in JDBC, there are efficiency trade-offs here
between the frequency of committing the transaction versus the natural transaction boundar-
ies. Some timings for this example are included in the next section.