jakartaee / jakartaee/messaging

Session.commit() etc should require TransactionInProgressException to be thrown if called in a JTA transaction

Open
#92 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pd20-veryminor Priority: Major Type: Improvement
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

The JMS 1.1 javadoc for TransactionInProgressException
http://docs.oracle.com/javaee/6/api/javax/jms/TransactionInProgressException.html
states:

This exception is thrown when an operation is invalid because a transaction is in progress. For instance, an attempt to call Session.commit when a session is part of a distributed transaction should throw a TransactionInProgressException.

However the javadoc for Session.commit does not list this as a mandatory exception.
http://docs.oracle.com/javaee/6/api/javax/jms/Session.html#commit%28%29

This is inconsistent.

It is hereby proposed that the definition of Session.commit and Session.rollback should be modified to require a TransactionInProgressException to be thrown when the session is in a JTA transaction.

Note that the corresponding methods on XASession already require these exceptions.

(and inconsistent with XASession.commit.

Affected Versions

[1.1]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Session.commit() and Session.rollback() API definitions and compare their exception requirements with the corresponding XASession methods. Review the JMS TransactionInProgressException documentation and the JTA transaction context described in the issue. Done means the affected method definitions consistently require this exception when called during a JTA transaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.