[seam-issues] [JBoss JIRA] Commented: (SEAMREMOTING-44) Remoting Model API lazy fields initialized automatically on Glassfish and AS7

Shane Bryzak (JIRA) jira-events at lists.jboss.org
Tue Aug 30 00:02:26 EDT 2011


    [ https://issues.jboss.org/browse/SEAMREMOTING-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624890#comment-12624890 ] 

Shane Bryzak commented on SEAMREMOTING-44:
------------------------------------------

I'm guessing that the issue is because of the following block of code in BagWrapper:

        try {
            Class<?> cls = Class.forName("org.hibernate.collection.PersistentCollection");

            // Fix to prevent uninitialized lazy loading in Hibernate
            if (cls.isInstance(value) && !loadLazy) {
                try {
                    Method m = cls.getMethod("wasInitialized");
                    if (((Boolean) m.invoke(value)).booleanValue() == false) {
                        out.write(UNDEFINED_TAG);
                        return;
                    }
                } catch (NoSuchMethodException ex) {
                } catch (InvocationTargetException ex) {
                } catch (IllegalAccessException ex) {
                }
            }
        } catch (ClassNotFoundException ex) {
        }

I'm going to need some assistance with this - specifically, the equivalent code that works in Glassfish which will determine whether the field is a persistent collection and whether it has been initialized or not.

> Remoting Model API lazy fields initialized automatically on Glassfish and AS7
> -----------------------------------------------------------------------------
>
>                 Key: SEAMREMOTING-44
>                 URL: https://issues.jboss.org/browse/SEAMREMOTING-44
>             Project: Seam Remoting
>          Issue Type: Bug
>    Affects Versions: 3.0.0.Final
>         Environment: seam remoting 3.0.1-SNAPSHOT, glassfish 3.1.1.b12 with default persistence provider (eclipselink) || jboss-as-7.1.0.Alpha1-SNAPSHOT with default persistence provider (hibernate 4)
>            Reporter: Marek Schmidt
>            Assignee: Shane Bryzak
>
> Lazy fields, such as
> {noformat}
> @OneToMany(fetch = FetchType.LAZY, mappedBy = "person",
>             cascade = CascadeType.ALL, orphanRemoval = true)
>     public Collection<Address> getAddresses() {
>         return addresses;
>     }
> {noformat}
> are loaded automatically in the model on AS7 and Glassfish. On JBoss AS 6, the field is works correctly and is undefined unless explicitly expanded.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list