You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Maxim Solodovnik (Jira)" <ji...@apache.org> on 2026/09/16 03:52:00 UTC

[jira] [Resolved] (OPENJPA-3005) Use jakarta.persistence.PersistenceUnitTransactionType internally instead of the deprecated SPI enum

     [ https://issues.apache.org/jira/browse/OPENJPA-3005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maxim Solodovnik resolved OPENJPA-3005.
---------------------------------------
      Assignee: Richard Zowalla
    Resolution: Fixed

> 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)