Proposal: Automatic Resource Management (original) (raw)
Bob Lee crazybob at crazybob.org
Wed Mar 4 00:16:39 PST 2009
- Previous message: Proposal: Automatic Resource Management
- Next message: Proposal: Automatic Resource Management
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Mar 3, 2009 at 11:37 PM, Neal Gafter <neal at gafter.com> wrote:
Bob-
java.sql.Connection has three methods (among others): commit() - to cause the transaction to take effect rollback() - to undo the transaction close() - to close the connection Using the construct as you suggest closes the connection - not necessarily a good idea, and not the point of the example. The point is to commit() when the controlled statement completes normally, and rollback() when it terminates abnormally, without the programmer having to add further boilerplate. BGGA enables frameworks to provide an API that makes this as easy as if a purpose-built statement were available, but the present proposal appears to require boilerplate in each client.
Neal-
Thanks for the tutorial. I've done quite a bit of JDBC and Java EE programming in the past (http://www.manning.com/tate2/), and I'm confident that the Automatic Resource Management proposal suits my needs just fine. :-)
Bob
- Previous message: Proposal: Automatic Resource Management
- Next message: Proposal: Automatic Resource Management
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]