0 Replies Latest reply on Mar 28, 2008 7:04 PM by cesar_takaide

    identity fields in Entity beans

    cesar_takaide

      Hello, I'm new in EJB3 technology. I'm working with an entity bean that has a identity field, so i wrote this on the field declaration:

      @Id
      @Column(name = "codigo", nullable = false)
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private Long codigo;

      But, when the entity is persisted, Jboss warns me with a message :

      16:42:52,947 WARN [WrappedConnection] Closing a result set you left open! Pleas
      e close it yourself.
      java.lang.Throwable: STACKTRACE
      at org.jboss.resource.adapter.jdbc.WrappedStatement.registerResultSet(Wr
      appedStatement.java:617)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.getGeneratedKeys(Wra
      ppedStatement.java:533)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      ...... etc...........

      Why is this happening? Is something wrong in my code? Thank you very much for your help.