[jboss-jira] [JBoss JIRA] (AS7-4019) Jboss Remoting and java transient fields.

Sueleyman Vurucu (JIRA) jira-events at lists.jboss.org
Sun Mar 4 07:59:36 EST 2012


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

Sueleyman Vurucu commented on AS7-4019:
---------------------------------------

Hi David,
I have an entity with a java transient field like,

private transient String  test             = "DEFAULT";

For this entitty I have a Serivce with the method:

  public BusinessObject saveGetObj(BusinessObject obj){
    return em.merge(obj);
  }

And this is my testcase:

  @Test
  public void test(){
    Employee emp = new Employee();
    emp.setName("EmplName");
    Assert.assertEquals("DEFAULT", emp.getTestString());
    emp.setTestString("TestNew");
    Assert.assertEquals("TestNew", emp.getTestString());
    BusinessObject empNew = service.saveGetObj(emp);
    Assert.assertNull(empNew.getTestString()); // This returns my transient field. This should be null. But I get allways the default value. 


  }

I hope that's enough. 


                
> Jboss Remoting  and java transient fields.
> ------------------------------------------
>
>                 Key: AS7-4019
>                 URL: https://issues.jboss.org/browse/AS7-4019
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: Remoting
>    Affects Versions: 7.1.0.Final
>         Environment: Windows XP
>            Reporter: Sueleyman Vurucu
>            Assignee: David Lloyd
>
> Java transient field with default values restore the default value after deserialisation. 
> This behaviour is different from the old remoting and standard java serialisation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list