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

[jira] Created: (OPENJPA-1523) Outside-Session Access to Entity fetched in Session fails

Outside-Session Access to Entity fetched in Session fails
---------------------------------------------------------

                 Key: OPENJPA-1523
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1523
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.0.0-beta
         Environment: Windows
            Reporter: bernard
            Priority: Critical
         Attachments: OutOfSession.zip

I am planning to migrate from TopLink Essentials. The application has an EJB tier so presentation logic must have access to Entity POJOs as feched in a session bean. That  should not a problem with the control provided by JPA fetching.

With TopLink Essentials fetching works well under GlassFish V2 and in Java SE standalone tests.

However OpenJPA fails in the attached testcase that closely maps the type of problem that we are facing in the container.

The workaround would be to "touch" all required properties in the session bean before the entities leave the persistence context. Such a workaround is not practical.

The attached testcase has a TopLink version for comparison. In both cases, a command line parameter has to be configured to match the absolute path:
-javaagent:dist\lib\openjpa-all-2.0.0-beta.jar
and
-javaagent:toplink-essentials-agent.jar

A switch CREATE_DATA_FIRST_TIME has to be set in the source code.

The testcase was created with the NetBeans IDE which includes the referenced TopLink library.



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


[jira] Commented: (OPENJPA-1523) Outside-Session Access to Entity fetched in Session fails

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836816#action_12836816 ] 

Kevin Sutter commented on OPENJPA-1523:
---------------------------------------

Although your reason for closing is valid from a pure JPA perspective, like EclipseLink, OpenJPA also provides the ability to override the default behavior.  This section [1] in the OpenJPA manual describes the configuration options available for making detached fields accessible (or not, depending on your preference).

[1]  http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_detach_graph

> Outside-Session Access to Entity fetched in Session fails
> ---------------------------------------------------------
>
>                 Key: OPENJPA-1523
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1523
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-beta
>         Environment: Windows
>            Reporter: bernard
>            Priority: Critical
>         Attachments: OutOfSession.zip
>
>
> I am planning to migrate from TopLink Essentials. The application has an EJB tier so presentation logic must have access to Entity POJOs as feched in a session bean. That  should not a problem with the control provided by JPA fetching.
> With TopLink Essentials fetching works well under GlassFish V2 and in Java SE standalone tests.
> However OpenJPA fails in the attached testcase that closely maps the type of problem that we are facing in the container.
> The workaround would be to "touch" all required properties in the session bean before the entities leave the persistence context. Such a workaround is not practical.
> The attached testcase has a TopLink version for comparison. In both cases, a command line parameter has to be configured to match the absolute path:
> -javaagent:dist\lib\openjpa-all-2.0.0-beta.jar
> and
> -javaagent:toplink-essentials-agent.jar
> A switch CREATE_DATA_FIRST_TIME has to be set in the source code.
> The testcase was created with the NetBeans IDE which includes the referenced TopLink library.

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


[jira] Updated: (OPENJPA-1523) Outside-Session Access to Entity fetched in Session fails

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

bernard updated OPENJPA-1523:
-----------------------------

    Attachment: OutOfSession.zip

Testcase 2 versions one for OpenJPA, one for TopLink

> Outside-Session Access to Entity fetched in Session fails
> ---------------------------------------------------------
>
>                 Key: OPENJPA-1523
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1523
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-beta
>         Environment: Windows
>            Reporter: bernard
>            Priority: Critical
>         Attachments: OutOfSession.zip
>
>
> I am planning to migrate from TopLink Essentials. The application has an EJB tier so presentation logic must have access to Entity POJOs as feched in a session bean. That  should not a problem with the control provided by JPA fetching.
> With TopLink Essentials fetching works well under GlassFish V2 and in Java SE standalone tests.
> However OpenJPA fails in the attached testcase that closely maps the type of problem that we are facing in the container.
> The workaround would be to "touch" all required properties in the session bean before the entities leave the persistence context. Such a workaround is not practical.
> The attached testcase has a TopLink version for comparison. In both cases, a command line parameter has to be configured to match the absolute path:
> -javaagent:dist\lib\openjpa-all-2.0.0-beta.jar
> and
> -javaagent:toplink-essentials-agent.jar
> A switch CREATE_DATA_FIRST_TIME has to be set in the source code.
> The testcase was created with the NetBeans IDE which includes the referenced TopLink library.

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


[jira] Closed: (OPENJPA-1523) Outside-Session Access to Entity fetched in Session fails

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

bernard closed OPENJPA-1523.
----------------------------

    Resolution: Invalid

JSR 317 about EntityManager getReference:

"The application should not expect that the instance state will be available upon detachment, unless it was accessed by the application while the entity manager was open."

Therefore, this is not a bug in the sense I thought it was. The fact that TopLink Essentials provides instance state upon detachment should not really matter here. Closing.

> Outside-Session Access to Entity fetched in Session fails
> ---------------------------------------------------------
>
>                 Key: OPENJPA-1523
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1523
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-beta
>         Environment: Windows
>            Reporter: bernard
>            Priority: Critical
>         Attachments: OutOfSession.zip
>
>
> I am planning to migrate from TopLink Essentials. The application has an EJB tier so presentation logic must have access to Entity POJOs as feched in a session bean. That  should not a problem with the control provided by JPA fetching.
> With TopLink Essentials fetching works well under GlassFish V2 and in Java SE standalone tests.
> However OpenJPA fails in the attached testcase that closely maps the type of problem that we are facing in the container.
> The workaround would be to "touch" all required properties in the session bean before the entities leave the persistence context. Such a workaround is not practical.
> The attached testcase has a TopLink version for comparison. In both cases, a command line parameter has to be configured to match the absolute path:
> -javaagent:dist\lib\openjpa-all-2.0.0-beta.jar
> and
> -javaagent:toplink-essentials-agent.jar
> A switch CREATE_DATA_FIRST_TIME has to be set in the source code.
> The testcase was created with the NetBeans IDE which includes the referenced TopLink library.

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