You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "David Ezzio (JIRA)" <ji...@apache.org> on 2010/04/02 21:12:27 UTC

[jira] Created: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
---------------------------------------------------------------------------------

                 Key: OPENJPA-1610
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
             Project: OpenJPA
          Issue Type: Improvement
          Components: jpa
    Affects Versions: 1.1.1
            Reporter: David Ezzio
            Assignee: David Ezzio
             Fix For: 1.1.1


OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
where applications using OpenJPA 1.x must run with the JPA 2.0 jar
present in the classpath.

Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
some methods to existing JPA interfaces that conflict with existing
signatures in OpenJPA interfaces.  These conflicts arise because
the OpenJPA interfaces extend the JPA interfaces that picked up the new 
methods.

To avoid the linkage errors that would result from no changes to
OpenJPA, when applications using the offending methods run in such an
environment, the two offending methods should be changed in the OpenJPA
interfaces.

Applications deployed in such environments should be recompiled to avoid
any possibility of using the old methods.

The offending methods are 

    public <T> T OpenJPAEntityManager.detach(T pc)
    public Properties OpenJPAEntityManagerFactory.getProperties()
    
The proposed fixes are designed to make recompilation and correction of
such applications as simple as possible. Such applications will compile
with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
only in JPA 2.0. Any such coding mistakes will result in linkage errors
when the methods or interfaces are used at runtime.

The proposed fixes:

    public <T> T OpenJPAEntityManager.detachCopy(T pc)
    public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
    
    public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
    
The first two fixes follow the changes made in OpenJPA 2.x to address
these same conflicts.

The getPropertiesAsProperties method is provided as a convenience to
application developers who do not want to accept the different return
type of the redesigned getProperties method. However, the method
getPropertiesAsProperties is not currently found in the OpenJPA 2.x
interface.

It is estimated that a large proportion of OpenJPA 1.x enabled
applications are using the old detach method and that a small proportion
are using the old getProperties method.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852932#action_12852932 ] 

David Ezzio commented on OPENJPA-1610:
--------------------------------------

Rev 930357 applied the changes to the 1.1.x branch.

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Ezzio closed OPENJPA-1610.
--------------------------------

    Resolution: Fixed

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>         Attachments: OpenJPA-1610-patch-CN957329.diff, Patch930357n378.diff
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891834#action_12891834 ] 

David Ezzio commented on OPENJPA-1610:
--------------------------------------

The changes applied at 930357 were premature and have been reverted.  The changes applied at 957329 have been preserved.

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>         Attachments: OpenJPA-1610-patch-CN957329.diff, Patch930357n378.diff
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Ezzio updated OPENJPA-1610:
---------------------------------

    Attachment: OpenJPA-1610-patch-CN957329.diff

Patch file for changes applied at CN 957329 on branch 1.1.x.

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>         Attachments: OpenJPA-1610-patch-CN957329.diff, Patch930357n378.diff
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881850#action_12881850 ] 

David Ezzio commented on OPENJPA-1610:
--------------------------------------

In the OpenJPA 1.1.x branch, when the PersistenceProductDerivation attempted to
parse a persistence.xml with the version attribute of the persistence element
set to 2.0, it threw a SAXParseException. This led to a spurious error message
that stymied users when the application is actually attempting to use another
persistence provider.

The solution is similar to the strategy used in JPA 2.0 to parse either JPA 1 or
JPA 2 compliant documents. A trivial, non-validating parser preparses the
document to determine the version. If the version is 2.0, then a warning is
issued, and the PersistenceProductDerivation load method returns a null
ConfigurationProvider. This in turns causes the PersistenceProviderImpl's create
EMF methods to adhere to their contracts of returning null when they are unable
to provide the required service.


> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>         Attachments: Patch930357n378.diff
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by David Ezzio <de...@apache.org>.
Hi Michael,

It's a good question, but I don't have these diffs ready to hand.  The 
SVN tool (SmartSVN) that I use conveniently allows me to ignore 
whitespace in comparisons.

I should have consider the problem and submitted the changes with the 
EOL changes separated out.

Sorry,

David

Michael Dick (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852943#action_12852943 ] 
> 
> Michael Dick commented on OPENJPA-1610:
> ---------------------------------------
> 
> Is there a patch without all the whitespace changes? 
> 
>> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
>> ---------------------------------------------------------------------------------
>>
>>                 Key: OPENJPA-1610
>>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>>             Project: OpenJPA
>>          Issue Type: Improvement
>>          Components: jpa
>>    Affects Versions: 1.1.1
>>            Reporter: David Ezzio
>>            Assignee: David Ezzio
>>             Fix For: 1.1.1
>>
>>
>> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
>> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
>> present in the classpath.
>> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
>> some methods to existing JPA interfaces that conflict with existing
>> signatures in OpenJPA interfaces.  These conflicts arise because
>> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
>> methods.
>> To avoid the linkage errors that would result from no changes to
>> OpenJPA, when applications using the offending methods run in such an
>> environment, the two offending methods should be changed in the OpenJPA
>> interfaces.
>> Applications deployed in such environments should be recompiled to avoid
>> any possibility of using the old methods.
>> The offending methods are 
>>     public <T> T OpenJPAEntityManager.detach(T pc)
>>     public Properties OpenJPAEntityManagerFactory.getProperties()
>>     
>> The proposed fixes are designed to make recompilation and correction of
>> such applications as simple as possible. Such applications will compile
>> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
>> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
>> only in JPA 2.0. Any such coding mistakes will result in linkage errors
>> when the methods or interfaces are used at runtime.
>> The proposed fixes:
>>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>>     
>>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>>     
>> The first two fixes follow the changes made in OpenJPA 2.x to address
>> these same conflicts.
>> The getPropertiesAsProperties method is provided as a convenience to
>> application developers who do not want to accept the different return
>> type of the redesigned getProperties method. However, the method
>> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
>> interface.
>> It is estimated that a large proportion of OpenJPA 1.x enabled
>> applications are using the old detach method and that a small proportion
>> are using the old getProperties method.
> 

[jira] Commented: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852943#action_12852943 ] 

Michael Dick commented on OPENJPA-1610:
---------------------------------------

Is there a patch without all the whitespace changes? 

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1610) Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Ezzio updated OPENJPA-1610:
---------------------------------

    Attachment: Patch930357n378.diff

Patch file that ignores whitespace changes in the changes applied to branch 1.1.x, at changes 930357 and 930378

> Allow applications using OpenJPA 1.x to run with the JPA 2.0 jar on the classpath
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1610
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1610
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 1.1.1
>            Reporter: David Ezzio
>            Assignee: David Ezzio
>             Fix For: 1.1.1
>
>         Attachments: Patch930357n378.diff
>
>
> OpenJPA 1.x does not support JPA 2.0, but there are runtime environments
> where applications using OpenJPA 1.x must run with the JPA 2.0 jar
> present in the classpath.
> Although JPA 2.0 is upwardly compatible with JPA 1.0, JPA 2.0 introduced
> some methods to existing JPA interfaces that conflict with existing
> signatures in OpenJPA interfaces.  These conflicts arise because
> the OpenJPA interfaces extend the JPA interfaces that picked up the new 
> methods.
> To avoid the linkage errors that would result from no changes to
> OpenJPA, when applications using the offending methods run in such an
> environment, the two offending methods should be changed in the OpenJPA
> interfaces.
> Applications deployed in such environments should be recompiled to avoid
> any possibility of using the old methods.
> The offending methods are 
>     public <T> T OpenJPAEntityManager.detach(T pc)
>     public Properties OpenJPAEntityManagerFactory.getProperties()
>     
> The proposed fixes are designed to make recompilation and correction of
> such applications as simple as possible. Such applications will compile
> with either the JPA 2.0 or JPA 1.0 jar, but they should be compiled with
> the JPA 1.0 jar to avoid mistakenly using interfaces or methods found
> only in JPA 2.0. Any such coding mistakes will result in linkage errors
> when the methods or interfaces are used at runtime.
> The proposed fixes:
>     public <T> T OpenJPAEntityManager.detachCopy(T pc)
>     public Map<String, Object) OpenJPAEntityManagerFactory.getProperties()
>     
>     public Properties OpenJPAEntityManagerFactory.getPropertiesAsProperties()
>     
> The first two fixes follow the changes made in OpenJPA 2.x to address
> these same conflicts.
> The getPropertiesAsProperties method is provided as a convenience to
> application developers who do not want to accept the different return
> type of the redesigned getProperties method. However, the method
> getPropertiesAsProperties is not currently found in the OpenJPA 2.x
> interface.
> It is estimated that a large proportion of OpenJPA 1.x enabled
> applications are using the old detach method and that a small proportion
> are using the old getProperties method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.