[ 
https://issues.apache.org/jira/browse/JDO-846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17928831#comment-17928831
 ] 

Craig L Russell edited comment on JDO-846 at 6/10/25 5:36 PM:
--------------------------------------------------------------

The javax.transaction.Synchronization interface has only two trivial methods: 
beforeCompletion and afterCompletion. In order to use these, the user must 
provide a class that implements the Synchronization interface. And the build 
process needs to declare a dependency on the jar files containing the 
interfaces.

We could remove the need for either javax or jakarta by providing an 
org.apache.jdo.Synchronization with the two methods. Then we would remove the 
import of javax.transaction.Synchronization. This would be a breaking change. 
And there would be a need for code changes in user code to change the import 
statements.

The usage of the Synchronization interface was changed from javax (or jakarta) 
where any number of Synchronizations could be registered via 
registerSynchronization. And there is no method that returns the list of 
Synchronization objects that have been registered. Instead, a single 
synchronization can be registered, and that instance can be obtained via 
getSynchronization, which is not a feature of javax or jakarta.

The callback afterCompletion(int status) also needs attention. The status value 
is defined by javax.transaction.Status which would still be needed unless we 
also defined our own org.apache.jdo.Status values.

If we did define org.apache.jdo interfaces and classes, there would still be 
the Intellectual Property issue. We would have to copy the contents of the 
Synchronization and Status code files potentially while keeping the license, or 
modifying the code and using the ASF 2.0 license. Neither of these options is 
appealing.

To summarize, it appears that there is little to be gained by doing anything at 
this point. We can revisit this issue if something happens in future, such as 
incompatible changes to the javax or jakarta Synchronization interfaces.


was (Author: clr):
The javax.transaction.Synchronization interface has only two trivial methods: 
beforeCompletion and afterCompletion. In order to use these, the user must 
provide a class that implements the Synchronization interface. 

We could remove the need for either javax or jakarta by providing an 
org.apache.Synchronization with the two methods. Then we would remove the 
import of javax.transaction.Synchronization. This would be a breaking change 
but there would not be any code changes in user code except for changing the 
import statement.

> Check upgrade references from javax to jakarta
> ----------------------------------------------
>
>                 Key: JDO-846
>                 URL: https://issues.apache.org/jira/browse/JDO-846
>             Project: JDO
>          Issue Type: Task
>          Components: api, tck
>    Affects Versions: JDO 3.2.1
>            Reporter: Michael Bouschen
>            Priority: Major
>
> The following packages switched from javax to jakarta:
>  * javax.persistence
>  * javax.transaction
> We should check whether we can support both packes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to