Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jta-dev] JTA Transactional Interface - Reasoning Comment for Checked Exception Handling
  • From: Tom Jenkinson <Tom.Jenkinson@xxxxxxx>
  • Date: Wed, 20 Aug 2025 12:24:44 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d2LZKTgdoYv6ZEjWBXywPMGYQJo4JCw6t9Xmj3Lpnm0=; b=Jhr1RlxkOZTAny7mGpyJ1RNsuQ8//CDp1WSl875LDdKtN8JMKI9WgzpMqs0Q0Bq2DGIwVjsMFCc/FRPDdu9tIbb2JHiphnVKRoOLziZj+vmyqHyRgaE/nxGMq2y3NRzkud+wzqNM0/SBLvgsJIudG/dx3QJz8jW61me+Zkon5lCKJH7d0j9Yj2+RfvUlbs7BNPe7AcFYZZhKOnutP5h5QfNUqx2NLqr9Q4CMorrS36fSue2c5dzhUkZZS5SqiklbiFA7AremWkn37w7A/bsYBsmccZZh9AipkRghhkreiTuMPptJ9S1XzzhiCQ5ewMhXllzZxdpusMJEjdBzGqAPvw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vNRf0wYWjQnau4Xn8ohA7r/cVZbnsMLVshZBFnQV1cWvkwXRCDup5CG6oe3YPDLn2l5Y522F/a9xdmp2SX0O3jWXJJef+XaUvsqi2nrlg6TMOmIvj/XwThfHE7hbBMLXYFMY9AElj5qLo7zrh2oCriFc1JMFVxVNhf7g75iLBYXtZx2l7lMJsiRVHdpa4RlOV41XhRVhkmIAcWT0EwdTd28M4DaTBMwXaVyBgpI4+9e2K+bMl+zqZF/pox19BV5euKepRGJe2ORlvOibeiGb7Q/vbPGQq4G7x9XACzdVPbbJvS6lsAB2lZ08KczScgxvsqzESIaSGT0vqHJqLsffNg==
  • Delivered-to: jta-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jta-dev/>
  • List-help: <mailto:jta-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jta-dev>, <mailto:jta-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jta-dev>, <mailto:jta-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHcEc1pmsAVKX4dxEWV8rdn1LIncw==
  • Thread-topic: [jta-dev] JTA Transactional Interface - Reasoning Comment for Checked Exception Handling

I welcome comments from the members of the Jakarta Transactions team that were involved in the addition of the Transactional annotation into the relevant version of the JavaEE JTA specification to provide some input on why this design approach was taken. Maybe it was a usability decision, but I
wasn't involved in that discussion.

I suppose it ends up as a trade-off between applications needing to manage a potentially list of exceptions to `dontRollbackOn` vs in the case any exception should rollback then adding `@Transactional(rollbackOn={Exception.class})`



On Tue, 2025-08-19 at 18:10 +0000, Bernd Huber via jta-dev wrote:
> Hello everyone,
> 
> in a quarkus issue developers have discussed about the reasoning behind the JTA Transactional Interface "Checked Exception Handling", which is described in the Comment of the "Transactional" Interface class:
>  * https://jakarta.ee/specifications/transactions/2.0/apidocs/jakarta/transaction/transactional
> 
> While the beviour itself is stated in the comment,
> it would be great to also have a reasoning why "Checked Exceptions" are not leading to the Rollback of the Transactions.
> 
> Quote:
> 
>  * By default checked exceptions do not result in the transactional interceptor marking the transaction for rollback and instances of RuntimeException and its subclasses do. This default behavior can be modified by specifying exceptions that result in the interceptor marking the transaction for
> rollback and/or exceptions that do not result in rollback.
> 
> It would be great if this comment could be enhanced with reasoning, 
> so developer teams can discuss about this behavior more clearly. 
> 
> Such a discussion can be seen in the following "Quarkus" Issue:
>  * https://github.com/quarkusio/quarkus/issues/34569
> 
> The Developers there (even the quarkus team itself) does not seem to be able to explain why checked exceptions are not also leading to the rollback, and where the benefit for transaction safety is, and why the default case is not to always rollback for any kind of exceptions, and exclude specific
> ones when needed (whitelist)
> 
> best regards,
> 
> Bernd Huber
> 
> 
>    Gesendet mit Proton Mail: ein sicherer E-Mail-Dienst. 
> _______________________________________________
> jta-dev mailing list
> jta-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jta-dev

Unless otherwise stated above:

IBM United Kingdom Limited
Registered in England and Wales with number 741598
Registered office: Building C, IBM Hursley Office, Hursley Park Road, Winchester, Hampshire SO21 2JN

Back to the top