Re: JSTL - <sql:transaction>, rollback?

From: Chris Smith (cdsmith_at_twu.net)
Date: 05/20/04


Date: Thu, 20 May 2004 15:07:41 -0600

Sid Eaton wrote:
> It's not clear from all the documentation I've read what constitutes a
> reason for JSTL to decide to rollback a transaction.

Apparently, the exception will be committed if the sql:transaction tag
completes normally, and rolled back if it fails with an exception
(including SQLException or any user-defined exception). So you could
throw an exception if you need explicit rollback; but if you're sticking
with no scriptlets, then you'd need to get another tag to do so on your
behalf.

For more flexibility, remove your JDBC code from the JSP page.

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation


Relevant Pages

  • BEGIN TRANSACTION problem
    ... there was no BEGIN TRANSACTION. ... The test prior to the exception is the first to execute the parent ... The is the exception the unit test is expecting. ... Rollback statement faile with "The ROLLBACK TRANSACTION request has no ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How To Tell Youre Within An Exception?
    ... using (Transaction transaction = new Transaction()) ... Rollbackif the current process is currently unwinding an exception ... I want to call Commitwithin the Dispose() ... Allthough in most cases you may rollback on error and commit on success, ...
    (microsoft.public.dotnet.framework.clr)
  • Transactions, eval, local and confusion
    ... I have read through the DBI docs and DBD::mysql docs a couple times and ... If the answer to number 1 is no, then presumably 'rollback' throws an ... setting AutoCommit to 0 before setting the RaiseError ... can put it after the RaiseError and let the eval catch its exception as ...
    (perl.dbi.users)
  • [Proposal] using statement enhancements
    ... Mostly always you use the using clause you deal with native ressources, ... exception handlinjg is sooner or later inevitable. ... Rollback(); ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Exception handling best practices
    ... The original statement would work but usually is not a good practice - all ... sensitive information in the original exception that you do not want exposed ... additional context information to aid users in figuring out why it didn't ... Rollback(); ...
    (microsoft.public.dotnet.general)