2 Replies Latest reply on Aug 12, 2002 3:42 PM by Joao Machado

    Transient Keyword problem ??

    Joao Machado Newbie

      I'm trying to migrate my application to JBOSS and I found a problem with the transient keyword. I have a class that acts as a Iterator. It have methods like hasNext(), next(), etc... This class is stored in the Web Tier (i.e. Servlet Vector) of my application and is passed to an EJB (Stateful Session Bean) method as an argument. I control the hasNext and next methods with int fields (currentIndex and size) and I want that when this class is serialized the currentIndex became zero (i.e. I reset the Iterator). To do this stuff I used the transient keyword with currentIndex field. With my old Application Server (Borland Application Server) it works fine and currentIndex is reseted before I call my EJB method, but with JBOSS (with the same JVM) it doesn't work and my currentIndex isn't seted to zero. Of course I could put a method reset in my class that solve the problem and call it before the serialization. With this modification the problem was solved, but I want to know if it is a JBOSS bug, JVM Bug, etc...
      Somebody have ideas, comments ??