Hi, First of all, thank you very much for this relevant contribution. We are validating the next JOnAS version 2.4 which will be available very soon. Therefore, we will unfortunately not able to integrate your contribution in this version. We will integrate it in the next version.
Thanks again. Best regards. H�l�ne. "Hoogervorst, Nico" wrote: > > With Solid as database, we had a problem with the java.lang.Long and > java.lang.Short > types in our beans. We use non-primitive types to be able to transfer > null-values. > java.lang.Long is mapped to the Jdbc-type BigInt, and java.lang.Short is > mapped to > the Jdbc-type SMALLINT. > > In the compiled stubs and skeletons, Jonas uses getObject() on the ResultSet > to get > the value from the database, like this (example from ejbLoad): > this.id = (java.lang.Long)rs.getObject(1); > > However, at runtime this resulted in class-cast exceptions, because in the > case > of Solid, the object returned for SMALLINT and BIGINT types, is a > java.lang.Integer. > > A similar problem existed for Oracle for the Integer type, see: > > > http://www.objectweb.org/messages/EjbContainerGroup/2001/06/msg00009.html > > I therefor suggest to use the getLong(), getShort() etc. methods on the > ResultSet, > which perform automatic type conversions. Then, the java.lang.Long or > java.lang.Short > can be easily created from the returned primitive type. Then, after this > call > the wasNull() method can be used to determine whether the value was actually > null. > I think, this will made the Jonas code more robust. > > Further I noticed that the java.math.BigInteger type didn't work with Jonas. > > To deal with the situation, I made a patch for Jonas. > > I hereby like to submit the sources I changed (based on Jonas-2-3-1). > I have attached them to this email. The involved sources are: > > org/objectweb/jonas_ejb/lib/JavaType.java > > and > > org/objectweb/jonas_ejb/tools/GenICEntityCMbyJDBCBean.java > > Nico Hoogervorst > Compuware > OptimalJ team > http://www.OptimalJ.com > > -------------------------------------------------------------------------------- > Name: JavaType.java > JavaType.java Type: unspecified type (application/octet-stream) > Encoding: quoted-printable > > Name: GenICEntityCMbyJDBCBean.java > GenICEntityCMbyJDBCBean.java Type: unspecified type (application/octet-stream) > Encoding: quoted-printable -- -=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- mailto:[EMAIL PROTECTED] http://www.evidian.com Phone: 33.4.76.29.73.53 Fax: 33.4.76.29.76.00 Download our EJB Server JOnAS at http://www.objectweb.org ---- To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "unsubscribe jonas-users". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
