1 Reply Latest reply on Oct 13, 2003 11:04 AM by yogesh_prajapati

    JBossDO enhancer makes POJO classes non serializable

    yogesh_prajapati

       

      "yogesh_prajapati" wrote:
      "yogesh_prajapati" wrote:
      I am using JBossDO (JBoss 4.0 DR2). I had this idea that since JDO is based on POJO, I could use them JDO objects as Data Transfer Object (DTO) between Business Logic and Presentation logic, but that's not true even if made my POJO classes serializable by implementing java.io.Serializable
      (however it looks like that it is supported with KODO http://www.solarmetric.com/Software/Documentation/latest/docs/j2ee_tutorial_architecture.html ). When my java client tries to access list of JDO objects as Collection from Session Facade, the EJB Server (JBoss) throws NotSerializableException referring JBossDO framework class org.jboss.persistence.jbossdo.JBossStateManagerImpl.

      I understand here that POJO classes are enhanced by JBossDO, but I don't understand why are these enhanced classes no longer serializable (limiting the benefits such as using them as DTO), I have this idea what if those newly inserted attributes referencing JDO Implementation classes are declared as transient. I think it will keep POJO classes complient with java.io.Serializable interface.

      It must completely be under user's (POJO developer) control make POJO serializable or keep POJO non serializable.

      Idea !!!


        • 1. Re: JBossDO enhancer makes POJO classes non serializable
          yogesh_prajapati

           

          "yogesh_prajapati" wrote:
          "yogesh_prajapati" wrote:
          I explored JDO api more and found that it is possible to detach PersistenceManager from enhanced JDO classes using "makeTransient()" method so that I could serialize JDO object, but it gives following exception:

          09:48:55,810 ERROR [STDERR] java.lang.UnsupportedOperationException
          09:48:55,811 ERROR [STDERR] at org.jboss.persistence.jbossdo.JBossPersistenceManagerInternal.makeTransactionalAll(JBossPersistenceManagerInternal.java:449)
          09:48:55,812 ERROR [STDERR] at org.jboss.persistence.jbossdo.JBossPersistenceManagerWrapper.makeTransientAll(JBossPersistenceManagerWrapper.java:326)
          09:48:55,812 ERROR [STDERR] at net.allentek.bas.ha.ejb.session.HospitalAdministratorBean.listHospitals(HospitalAdministratorBean.java:156)
          0