Hibernate lazy loading with spring

Has anyone been able to successfully implement the org.springframework.orm.hibernate3.support.PortletOpenSessionInViewInterceptor to enable hibernate lazy loading with page flows? Any examples would be helpful.
Thanks

Don't double post. I've removed the thread you started 3 hrs 16 minutes after this one with the identically same question.
db

Similar Messages

  • It doesn�t work lazy loading with remote client (toplink)

    I am trying to use lazy loading in a @ManyToOne field but I get an exception. I have been reading in some oracle tutorials that it's necesary use -javaagent:.../lib/toplink-essentials-agent.jar for that it works because this argument activate dynamic weaving in JavaSE. I have put this command line argument javaagent but it doesn't work. Why? Can I have to do another thing? I have done a lot of tests in base to comments read in another forums but I only obtains an exception.
    Caused by: java.io.IOException: Mismatched serialization UIDs
    NOTE: The server use toplink and the remote client query the entitties through a session bean of the server. Besides, I am using Glassfish (Sun application server and toplink).
    Thanks in advance.
    hayken

    At first, thank you for your reply.
    I know that I haven´t explained the problem too well. I have a stateless bean with one remote method that execute a query an returns an entity like this
    @Entity
    public class ModuloEntity extends Serializable
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idModulo;
    private String nombre;
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="IdProyecto")
    private ProyectoEntity proyecto;
    The remote client invoke this method and in that moment I get this exception.
    21-may-2007 18:55:48 com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    ADVERTENCIA: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7053)
    Caused by: java.io.IOException: Mismatched serialization UIDs : Source (Rep. IDRMI:com.syskonic.gesplan.entities.ModuloEntity:6D06A8C14D488FFF:8E6FC8687EA9E512) = 8E6FC8687EA9E512 whereas Target (Rep. ID RMI:com.syskonic.gesplan.entities.ModuloEntity:1C6925798CDFD3DF:3455DBF4457AE337) = 3455DBF4457AE337
    at com.sun.corba.ee.impl.util.RepositoryId.useFullValueDescription(RepositoryId.java:573)
    If I look the server log, I can see that the call has not been produced, it doesn´t show any exception. It looks that the object managed by the server and the remote client aren´t the same and the corba service doesn´t work when remote client call session method. If I change the ModuloEntity and remove the fetch attribute then all this process executes correctly. The problem is in this attribute.
    NOTE: I am using the javaagent command line argument.
    Hayken

  • JSF and Hibernate Lazy loading

    Hello,
    It seems like Hibernate session is being closed after exception. This makes a conflict with JSF, since after session is closed lazy initialization cannot take place and the view of the page cannot be rendered.
    Is it right that Hibernate session is closed after exception ?
    How can this problem be treated ?

    Thanks,
    The problem happened since I was making rollback right after the exception. The session is closed after a rollback ...
    I am already using session-per-request (my own implementation). I changed the code to make rollback only once at the end of the filter. If a caught exception happens during request I only register a request for rollback.

  • JPA lazy loading with Firebirdsql

    I'm trying to use FetchType.Lazy in @OneToOne associations, with a firebirdsql database.
    Toplink JPA generates the sql query as follow:
    SELECT FIELD1, FIELD2, _TOPLINK_FIELD3_VH, ... FROM TABLE.....
    This select gets this error msg:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: org.firebirdsql.jdbc.FBSQLException: Exception. nullError Code: 0
    (it can't find the TOPLINKFIELD3_VH field)
    Is this an issue related to firebirdsql support on Toplink?
    Or is it a issue related to firebirdsql JDBC driver/database?

    Don't double post. I've removed the thread you started 3 hrs 16 minutes after this one with the identically same question.
    db

  • Facing problem with lazy loading in ejb3.0

    The following error is coming up when i try to access the collection in the entity entity bean. i am using entitymanager.find() to retrieve the entity. intial set of values are coming fine but when try to access the collection in the entity the error is coming up. one solution is to make the fetch type=eager. but can we do lazy loading with out any problem. the following is the error. kindly help me in this. do i need to do anything extra that mean have to add any annotations or anything.
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.lucid.erp.entities.EmployeeDTO.addresses, no session or session was closed
         at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
         at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
         at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
         at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
         at org.hibernate.collection.PersistentBag.get(PersistentBag.java:422)
         at com.lucidlabs.erp.actions.EmployeeAction.view(EmployeeAction.java:20)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
         at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
         at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
         at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at

    this is transactions 101 material. Do you know about transactions and how they work? Do you know about managed entities?
    The problem you are having is that the addresses are accessed outside of the transaction in which the entity was fetched. That means there is no more database session and thus the lazy fetch cannot work. If you really need the addresses, you can at least force fetch them by calling getAddresses().size() right after you fetch the entity from the database; assuming that the transaction is still active at that point.

  • Lazy loading in blazeds

    Hi ,
    Can anyone tell me how to have support for lazy loading with blazeds.I am not using hibernate etc on server side only jboss and ejbs to acess DB.

    Hi Maitrey,
    dpHibernate is an external project, that solves this common problem.
    http://code.google.com/p/dphibernate/
    Best regards,
    Sd.Plox

  • Lazy Loading, Muse, and Scripts

    Hi, I'm trying to integrate Lazy loading with Muse in a Web Site.
    I would like know if anyone has a better workflow...
    So, first I uploaded to the server the "lazy loading content"
    http://dandalo.net/teste/lazy-patricia/lazy-pat.html
    Then, in Muse, I inserted the html from the page source that I had uploaded.
    http://dandalo.net/teste/export-muse/detalhes-old.html
    But it didn't work... : (
    So... 
    I have started looking at the html code that Muse created and fond this special phrase...    <!-- Other scripts -->
    Then, I tried this:
    Coping the scripts from the "lazy loading content" page and pasting it after this special line:
    http://dandalo.net/teste/export-muse/detalhes.html
    And it Worked !!!
    PS: The java scrips should be in root folder, not in the Scripts folder that Muse created
    Does anyone have any tip or workflow not to have to edit the html file to add these script lines?

    Hi
    Do you have the link to the "lazy loading content"?
    I can't find a proper way to do it.
    Thanks

  • Flex Lazy Loading Tree example posted

    Hi, all;
    I've posted a new example to my blog:
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    This example demonstrates
    - Using lazy loading with a Tree component.
    - Using an interface rather than a concrete type to allow the
    LazyDataDescriptor to work with any class that implements
    LazyLoading.
    - An all-actionscript remoting connection
    It also has the PHP files and instructions for creating the
    mySQL database
    that provide the service data.

    "danger42" <[email protected]> wrote in
    message
    news:gkig47$hqu$[email protected]..
    > Very cool!
    Thanks :-)

  • BlazeDS "Configure return type" not working with Hibernate lazy fetching

    I am using the new BlazeDS 4 with Flash Builder 4.
    Backend configuration: Spring 3.0 + Spring-BlazeDS 1.0.3 + Hibernate 3.5
    I have successfully configured my Spring-BlazeDS project based on this excellent video tutorial by James Ward.
    The problem:
    While trying to use the "Configure return type" option for one of my service calls, or the "Test operation" option, I get the following exception thrown:
    InvocationTargetException:There was an error while  invoking the operation. Check your server settings and try invoking the  operation again.
    Reason: Server error failed to lazily initialize a  collection of role:  com.xyz.product.domain.MyEntityClass.myLazyCollection, no  session or session was closed null
    I am well aware of lazy loading issues and configured Gilead to handle this, hopefully with success although I cannot indicate this for sure yet.
    However - in this case, i'm not certain it's even related to Gilead, because this is happening on server side and not on client as far as I understand so Gilead isn't playing its role in removing the proxy associations. BlazeDS however is trying to fully inspect whatever object graph it gets, and appearantly does that outside of a persistence session scope, hence the LazyInitializationException.
    Is this a BlazeDS bug? Can BlazeDS do the objects inspection within a provided open persistence context session to avoid this?
    See also stacktrace from server:
    1327066 [tomcat-http--32] ERROR org.hibernate.LazyInitializationException - failed to lazily initialize a collection of role: com.xyz.product.domain.MyEntityClass.myLazyCollection, no session or session was closed
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.xyz.product.domain.MyEntityClass.myLazyCollection, no session or session was closed
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(Ab stractPersistentCollection.java:380)
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfN otConnected(AbstractPersistentCollection.java:372)
        at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollec tion.java:365)
        at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.j ava:108)
        at org.hibernate.collection.PersistentBag.toArray(PersistentBag.java:280)
        at java.util.ArrayList.<init>(ArrayList.java:131)
        at flex.messaging.io.ArrayCollection.<init>(ArrayCollection.java:44)
        at flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:455)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:175)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:817)
        at flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:431)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:179)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:556)
        at flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:462)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:175)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf0Output.writeObject(Amf0Output.java:193)
        at flex.messaging.io.amf.Java15Amf0Output.writeObject(Java15Amf0Output.java:41)
        at flex.messaging.io.amf.AmfMessageSerializer.writeObject(AmfMessageSerializer.java:196)
        at flex.messaging.io.amf.AmfMessageSerializer.writeBody(AmfMessageSerializer.java:186)
        at flex.messaging.io.amf.AmfMessageSerializer.writeMessage(AmfMessageSerializer.java:142)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:179)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
        at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$c487cc23.service(<generated>)
        at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerA dapter.java:101)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644 )
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:343)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(Filter SecurityInterceptor.java:109)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(Filt erSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTran slationFilter.java:97)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManageme ntFilter.java:100)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(An onymousAuthenticationFilter.java:78)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFil ter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCac heAwareFilter.java:35)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.do Filter(AbstractAuthenticationProcessingFilter.java:188)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter .java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(Securi tyContextPersistenceFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy .java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java: 167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at com.springsource.metrics.collection.web.HttpRequestMetricCollectionValve.invoke(HttpReque stMetricCollectionValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
    [BlazeDS] Exception occurred during serialization: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.xyz.product.domain.MyEntityClass.myLazyCollection, no session or session was closed
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(Ab stractPersistentCollection.java:380)
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfN otConnected(AbstractPersistentCollection.java:372)
        at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollec tion.java:365)
        at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.j ava:108)
        at org.hibernate.collection.PersistentBag.toArray(PersistentBag.java:280)
        at java.util.ArrayList.<init>(ArrayList.java:131)
        at flex.messaging.io.ArrayCollection.<init>(ArrayCollection.java:44)
        at flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:455)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:175)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:817)
        at flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:431)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:179)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:556)
        at flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:462)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:175)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
        at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
        at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
        at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
        at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
        at flex.messaging.io.amf.Amf0Output.writeObject(Amf0Output.java:193)
        at flex.messaging.io.amf.Java15Amf0Output.writeObject(Java15Amf0Output.java:41)
        at flex.messaging.io.amf.AmfMessageSerializer.writeObject(AmfMessageSerializer.java:196)
        at flex.messaging.io.amf.AmfMessageSerializer.writeBody(AmfMessageSerializer.java:186)
        at flex.messaging.io.amf.AmfMessageSerializer.writeMessage(AmfMessageSerializer.java:142)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:179)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
        at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$c487cc23.service(<generated>)
        at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerA dapter.java:101)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644 )
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:343)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(Filter SecurityInterceptor.java:109)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(Filt erSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTran slationFilter.java:97)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManageme ntFilter.java:100)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(An onymousAuthenticationFilter.java:78)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFil ter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCac heAwareFilter.java:35)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.do Filter(AbstractAuthenticationProcessingFilter.java:188)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter .java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(Securi tyContextPersistenceFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChain Proxy.java:355)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy .java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java: 167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at com.springsource.metrics.collection.web.HttpRequestMetricCollectionValve.invoke(HttpReque stMetricCollectionValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

    slacknatcher wrote:
    the parts i had searched on google are specificaly the
    "/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x12): undefined reference to `__libc_csu_fini'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x19): undefined reference to `__libc_csu_init'"
    does anyone have an idea of what could it be?
    notice that this doesn't bother me because if i use the glibc from the repositories everything works fine, this is just for curiosity of why it doesn't work
    thanks in advance
    You have stripped glibc too much.  See the Arch PKGBUILD and make sure your makepkg.conf has STRIP_BINARY etc defined.

  • Problem with module lazy loading in flex 3

    Hi every body!
    I have some problems with Module lazy loading. I am using flex 3.5, Module-flex3-0.14, parsley 3.2.
    I can't get the LazyModuleLoadPolicy working correctly.
    In my main application (the one that loads the modules), my parsley context is the following:
            <cairngorm:LazyModuleLoadPolicy objectId="lazyLoadPolicy" type="{ OpenViewMessage }" />
         <cairngorm:ModuleMessageInterceptor type="{ OpenViewMessage }"/>
         <cairngorm:ParsleyModuleDescriptor objectId="test"
              url="TestModule.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />
    And to load my module:
    [Inject(id="test")]
    [Bindable] public var test:IModuleManager;
    <core:LazyModulePod
         id="moduleLoader"
         moduleManager="{test}"
         moduleId="testModule"
    />
    with  LazyModulePod.mxml:
    <mx:Canvas
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:module="com.adobe.cairngorm.module.*"
        xmlns:parsley="http://www.spicefactory.org/parsley">
        <mx:Script>
            <![CDATA[
                import com.adobe.cairngorm.module.ILoadPolicy;
                import com.adobe.cairngorm.module.IModuleManager;
                [Bindable]
                public var moduleId:String;
                [Bindable]
                public var moduleManager:IModuleManager;
                [Bindable]
                [Inject(id="lazyLoadPolicy")]
                public var lazyLoadPolicy:ILoadPolicy;
            ]]>
        </mx:Script>
        <parsley:Configure/>
        <module:ViewLoader id="moduleLoader"
            moduleId="{ moduleId }"
            moduleManager="{ moduleManager }"
            loadPolicy="{lazyLoadPolicy}">
             <!--<module:loadPolicy>
                  <module:BasicLoadPolicy/>
             </module:loadPolicy>-->
        </module:ViewLoader>
    </mx:Canvas>
    OpenViewMessage.as in a swc:
    public class OpenViewMessage
            private var _moduleId:String;
            private var _viewId:String;
            public function OpenViewMessage(moduleId:String, viewId:String)
                this._moduleId = moduleId;
                this._viewId = viewId;
            public function get viewId():String{
                return _viewId;
            [ModuleId]
            public function get moduleId():String
                return _moduleId;
    In another flex project, my module context is:
    <mx:Object
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:controler="com.cegedim.myit.controler.*">
         <controler:WindowControler/>
    </mx:Object>
    The module implements IParsleyModule
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
         implements="com.adobe.cairngorm.module.IParsleyModule"
         xmlns:spicefactory="http://www.spicefactory.org/parsley">
         <mx:Script>
              <![CDATA[
                   import org.spicefactory.parsley.flex.FlexContextBuilder;
                   import com.adobe.cairngorm.module.IParsleyModule;
                   public function get contextBuilder():ContextBuilderTag
                    return contextBuilderTag;
              ]]>
         </mx:Script>
         <spicefactory:ContextBuilder  id="contextBuilderTag" config="{ MyITTestModuleContext }"/>
         <spicefactory:Configure/>
    </mx:Module>
    and the WindowControler:
    public class WindowControler
         public function WindowControler(){}
         [Init]
            public function initialize():void
                Alert.show("Module Initialized");
            [MessageHandler(scope="local")]
            public function openViewMessageHandler(message:OpenViewMessage):void
                Alert.show("Opening view " + message.viewId + " in the module " + message.moduleId);
    If i uncomment the basicLoadPolicy in LazyModulePod.mxml and remove the lazyModuleLoadPolicy, everything works fine. The module is loaded when it's added to stage and it receives correctly messages dispatched to it. But with the lazy policy the module never loads.
    I may have missed something or there is somthing i don't understand because i tried the ModuleTest provided in example in cairngorm sources. It works fine (i mean loading the moduleA2 when receiving a message), but if i replace the change the lazyModulePolicy to listen to broadcasted messages instead of a pingMessage, the module never loads too.
        <cairngorm:LazyModuleLoadPolicy objectId="lazyLoadPolicy" type="{ BroadcastMessage }" />
        <cairngorm:ModuleMessageInterceptor
            type="{ BroadcastMessage }" moduleRef="moduleA" />
    public class BroadcastMessage
        public function BroadcastMessage()
    If someone has any clue, i'll be happy to test it =)
    Thanks.

    Hello, back on my issue, i tested a little bit more the message dispaching.
    I read the lazyLoadPolicy class and noticed that it always has to have a ModuleId property in the message to work, that's why the broadcast message didn't work to awake the module with the lazy loading policy.
    So i added copy of my module:
         <cairngorm:ParsleyModuleDescriptor objectId="test"
              url="TestModule.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />
         <cairngorm:ParsleyModuleDescriptor objectId="testbis"
              url="TestModuleBis.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />     
    Set them both with a basicLoadPolicy, and tries to dispatch a message to only one of them using the ModuleId metatag. I then noticed that both modules received the message and not only the one i expected.
    I then changed the ModuleMessageInterceptor configuration to dispatch to only one kind of module:
    <cairngorm:ModuleMessageInterceptor type="{ OpenViewMessage }" moduleRef="test"/>
    and this worked as expected. Only the first module catched the message. I am obiously messing with the ModuleId metatag but i cannot see what's wrong...
    I compiled with
    -keep-as3-metadata+=ModuleId
    but this hasn't changed anything...

  • It seems you cannot clone objects with attributes using lazy loading in JPA

    I have an entity with an attribute using lazy loading:
    @Entity
    public class B {
    @ManyToOne(fetch=FetchType.LAZY)
    private A a;
    @Entity
    public class A {
    Assume the following code:
    A a1 = new A();
    A a2 = new A();
    B b1 = EntityManager.find(B.class, ...);
    b1.setA(a1);
    B b2 = b1.clone();
    b2.setA(a2);
    Now with lazy loading enabled I get b1.getA() == a2 instead of b1.getA() == a1. Moreover, the debugger displays the same value holder in b1 and b2 for the attribute a. It appears as if cloning does not make a (deep) copy of the value holder managing the attribute a.
    How can I create a copy b2 of b1, such that the value holder managing a in b1 is a different object as the value holder managing a in b2?
    Thanks, Thomas.

    I have filed a bug to have this addressed in Oracle TopLink 11gR1. I would recommend you file a bug against TopLink Essentials in GlassFish or if you have a support contract report the issue to metalink to have the issue resolved.
    If this is urgent I did try fixing the issue with a small helper method using some reflection. This method is simplified through its throwing of Exception. If you wish to use something like this I would recommend proper error handling.
         * Helper method for cloning an entity and fixing the woven value-holders to
         * complete a proper shallow cloning.
        public static Employee clone(Employee entity) throws Exception {
           Employee clone = entity.clone();
           // Now fix the cloned ValueHolder references
           Field[] fields = entity.getClass().getDeclaredFields();
           for (int index = 0; index < fields.length; index++) {
               Field field = fields[index];
               if (field.getName().startsWith("_toplink_")) {
                   field.setAccessible(true);
                   ValueHolderInterface vhi = (ValueHolderInterface)field.get(entity);
                   Object value = vhi.isInstantiated() ? vhi.getValue() : null;
                   field.set(clone, new ValueHolder(value));
           return clone;
        }Doug

  • Configuring Lazy Loading on Finder Methods with Annotations

    Hi!
    I would like to ask you if it is possible to "Configuring Lazy Loading on Finder Methods with Annotations" in Toplink Essentials, using annotations instead of deployment descriptor.
    Thank you,
    Florin

    I am not sure what you are asking. Lazy loading is configured on the mapping, not the queries.
    There are examples on how to configure lazy loading on mappings at www.otn.oracle.com/jpa. If this is not what youare trying to do, please give me a use case that you are trying to support. thanks
    Peter

  • Serializing an entity with lazy loaded relationships

    Cross-posted from http://forum.java.sun.com/thread.jspa?threadID=793605
    Started to think I posted to the wrong forum.
    Is it possible to use FetchType.LAZY when sending an entity (let's say Person) to a remote client? I'm fine with the fact that a call like person.getAddress() would have to return null or throw an exception of some sort. But, is it possible to even send the Person object when using lazy fetching?

    I have tried, unsuccessfully. The reason I posted this question is that I don't have the experience to know if my failure is due to the goal being impossible or just do to a mistake I made. So, telling me to try doesn't help answer my question. So let me restate...
    Can YOU serialize an entity (sending it to a remote client) even though the entity has lazy-loaded relationships? I know that I cannot.
    Everything I have read implies that it is possible. However, I have been unable to pull this off using NB 5.5 and the Sun App Serv 9.0. If I make the relationships FetchType.EAGER, everything works. Using FetchType.LAZY, I can't even send the entity to the client, EVEN IF the client doesn't do anything with the entity.

  • IPlanet Compatibility with Spring/Hibernate

    Hi,
    I need to develop a J2EE application.
    I need to used iPlanet as a Web Server.
    I want to know the compatibility if iPlanet with Spring/Hibernate.
    Is it possible to develop an application using Spring/Hibernate if iPlanet is the Web Server.
    thanks

    Do you mean iPlanet Web Server 6.0? That's more than 7 years old. It's no longer supported by Sun and contains unfixed security vulnerabilities that make it unfit for production use. Modern versions of Spring and Hibernate won't work with the ancient version of the Java Servlet specification implemented by Web Server 6.0.
    Spring and Hibernate will, however, work with the current iteration of Sun's web server product, Sun Java System Web Server 7.0.

  • Lazy loading, EntityManager and concurrency.

    I need advice which strategy to use with lazy loading.
    My project is based on Spring, Struts 2 and Hibernate JPA. I have enough OneToMany and ManyToMany relationships and it's reasonable to use lazy loading. It seems very convenient to load data in Struts Actions with OpenEntityManagerInViewFilter in such way like:
    Style style = user.getStyle()
    But to avoid LazyLoadException I have to use:
    @PersistenceContext(type=PersistenceContextType.EXTENDED)
    Unfortunately, EntityManager in this case becomes not thread-safe, according to Spring docs: "+Extended EntityManagers are not thread-safe, hence they must not be used in concurrently accessed beans (which Spring-managed singletons usually are).+" EXTENDED means that EntityManager is shared in user session and my EntityManager is injected in singleton services.
    I've found this issue when tried to make quick sequential page reloading which call some selects and got:
    java.sql.SQLException: You can't operate on a closed Statement!!!
    What's the best practice in this situation:
    1. Try synchronize session access to EntityManager by myself or put each user database requests in separate queue (something terrible I suppose).
    2. Use HQL queries with join fetch to preload data for access outside of transaction (maybe overhead).
    3. Or something else???
    And why we need EXTENDED context if it's so unreliable??
    Thanks for help!

    Hi
    Do you have the link to the "lazy loading content"?
    I can't find a proper way to do it.
    Thanks

Maybe you are looking for

  • How to track the change of an asset via field ANLC-KANSW?

    I'm trying to track any change to the value of an asset. I'm looking at field ANLC-KANSW. I'm not sure how to do it, but if you change the value of an asset, the change is not reflected in the field itself, but other "cumulative  fields in ANLC. The

  • Problems with opening CS3 doc in CS5 (stroke added, etc.)

    After importing documents to CS5 from CS3 I find that I have strokes in the text frames (some of them at least) and the page numbers lack kerning. http://tinypic.com/r/2mzfy1c/7 No stroke exists in the text frames belonging to the master pages, nor d

  • SQL 2005 backup

    Hi, I'm using Small Business Server 2003. I've installed SQL 2005 Database Server for ERP. I need to take the backup of the both SMB 2003 and SQL Database. If I take Full back from SMB 2003 will this also take backup of my SQL 2005. Or do I need to t

  • HT5463 Is there a way to schedule do not disturb to have different options for weekend vs weekday?

    Is there a way to schedule the do not disturb to have different schedules for weekend vs weekday?

  • System info through applet

    Hello, I need to retrieve Windows system info (like memory usage, CPU usage) through my applet and return it back to the server. I am going to retrieve that info using Windows API, create an executable and run it through my applet using Runtime.exec