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

ASF subversion and git services commented on OPENJPA-3005:
----------------------------------------------------------

Commit 1dcf7bea23ee3ff3f2c00122228ec8c80b1cb6da in openjpa's branch 
refs/heads/OPENJPA-2977 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=1dcf7bea2 ]

[OPENJPA-3005] Use jakarta.persistence.PersistenceUnitTransactionType internally

PersistenceUnitInfoImpl keeps the transaction type as the non-deprecated
jakarta.persistence.PersistenceUnitTransactionType and only converts to the
SPI enum in getTransactionType(), which PersistenceUnitInfo still requires in
Jakarta Persistence 3.2. A deprecated setter taking the SPI enum is kept.

The jakarta.persistence.transactionType property now accepts both enums, a
jakarta.persistence.PersistenceUnitTransactionType value was silently turned
into a null transaction type before.


> Use jakarta.persistence.PersistenceUnitTransactionType internally instead of 
> the deprecated SPI enum
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3005
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3005
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: jpa
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> Jakarta Persistence 3.2 deprecates 
> {{jakarta.persistence.spi.PersistenceUnitTransactionType}} \(forRemoval = 
> true\) in favour of {{jakarta.persistence.PersistenceUnitTransactionType}}. 
> {{EntityManagerFactoryImpl}} already uses the new enum, while 
> {{PersistenceUnitInfoImpl}} and {{PersistenceProductDerivation}} still use 
> the SPI one.
> A plain import swap is not possible: 
> {{PersistenceUnitInfo#getTransactionType\(\)}} still returns the SPI enum in 
> 3.2 \(the spec announces the return type change for the next major version\), 
> and {{PersistenceUnitInfoImpl}} implements that interface.
> In addition, passing {{jakarta.persistence.transactionType}} as a 
> {{jakarta.persistence.PersistenceUnitTransactionType}} value \(rather than a 
> String or the SPI enum\) is silently turned into a null transaction type.
> Proposal:
> \* keep the transaction type in {{PersistenceUnitInfoImpl}} as 
> {{jakarta.persistence.PersistenceUnitTransactionType}}, and convert to the 
> SPI enum only in {{getTransactionType\(\)}}
> \* keep a deprecated {{setTransactionType}} overload taking the SPI enum
> \* accept both enums \(and Strings\) for the 
> {{jakarta.persistence.transactionType}} property
> \* drop the manual JTA/RESOURCE\_LOCAL mapping in 
> {{convert\(PersistenceConfiguration\)}}
> Once the spec changes the return type, only the getter needs to change.



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

Reply via email to