Announcement Announcement Module
Collapse
No announcement yet.
How to disable Hibernate serialization/deserialization support?? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to disable Hibernate serialization/deserialization support??

    Hi all,

    I just need to disable Hibernate serialization/deserialization support?

    We are using Hibernate with DTO pattern and we don't want serializing model entities.

    I don't understand why the Hibernate serialization/deserialization support is automatically configured. It should be done on demand inside messageBroker configuration:

    <flex:message-broker>
    <flex:config-processor /> <!-- enable defaut jpa processor -->
    </flex:message-broker>

    Should I create a Jira issue for that?

    Best regards,

    Remi

  • #2
    Jeremy ? Any idea about this problem?

    Comment


    • #3
      I had the same problem and I solved it by extending HibernateConfigProcessor:

      Code:
      public class DisableHibernateConfigProcessor extends HibernateConfigProcessor
      {
      	@Override
      	public void afterPropertiesSet() throws Exception
      	{
      		// do nothing
      	}
      }
      and setting it as a config-processor to the message-broker:

      Code:
      	<flex:message-broker
      		services-config-path="classpath:flex/services-config.xml"
      		disable-default-mapping="false"
      	>
      		<flex:config-processor ref="disableHibernateProcessor"/>
      		<flex:remoting-service default-channels="mainChannel,messagingChannel"/>
      		<flex:secured />
      	</flex:message-broker>
      
      	<bean id="disableHibernateProcessor" class="your.package.DisableHibernateConfigProcessor">
      	</bean>
      Regards,
      Markus

      Comment


      • #4
        Hello,

        I also had the same problem and the solution given by pappnas worked perfectly, so thank you very much.
        I agree with the fact that the hibernate serialization support should not be automatically enabled just by scanning the classpath for the hibernate libraries availability...
        I also use DTOs so there is no need to carry hibernate entities through AMF.
        More important: I use hibernate 4 and this automatic initialization simply... fails!

        Well, maybe this support for hibernate/JPA should not be activated automatically and maybe the spring-flex support should be upgraded to support hibernate 4.

        Regards,

        Benoit

        Comment


        • #5
          I provided a opensource for Hibernate lazy loading issue.
          http://code.google.com/p/rich-hibernate-lazy/

          Comment

          Working...
          X