[
https://issues.apache.org/jira/browse/OPENJPA-3005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116554#comment-18116554
]
ASF subversion and git services commented on OPENJPA-3005:
----------------------------------------------------------
Commit 830a0b41c1642f3fc1c01db2baead3df818e2ce2 in openjpa's branch
refs/heads/OPENJPA-2977-no-persistence-xml-resource from Paulo Cristovão de
Araújo Silva Filho
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=830a0b41c ]
Merge pull request #190 from apache/OPENJPA-3005
[OPENJPA-3005] Use jakarta.persistence.PersistenceUnitTransactionType internally
> 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)