Hye,
> -----Message d'origine-----
> De : Bruce Snyder [mailto:[EMAIL PROTECTED]
> Envoy� : jeu. 13 novembre 2003 02:21
> � : [EMAIL PROTECTED]
> Objet : Re: [castor-dev] JDO : DateFormat not multithread safe
>
>
> This one time, at band camp, DU SONG Romuald said:
>
> DSR>> I think I have found a problem when stress testing my
> application with
> DSR>> JDO/Castor 0.9.5.2.
> DSR>> I have the stacktrace :
> DSR>> java.lang.NumberFormatException: For input string: ""
> DSR>> at
> DSR>>
> java.lang.NumberFormatException.forInputString(NumberFormatExc
> eption.java:
> DSR>> 48)
> DSR>> at java.lang.Long.parseLong(Long.java:415)
> DSR>> at java.lang.Long.parseLong(Long.java:452)
> DSR>> at java.text.DigitList.getLong(DigitList.java:149)
> DSR>> at
> java.text.DecimalFormat.parse(DecimalFormat.java:1068)
> DSR>> at
> java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1705)
> DSR>> at
> java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1156)
> DSR>> at java.text.DateFormat.parse(DateFormat.java:333)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLTypes$65.convert(SQLTypes.java:941)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine.toJava(SQLEngine.java:490)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine.access$500(SQLEngine.java:108)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadSingleFiel
> d(SQLEngine.
> DSR>> java:1815)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadRow(SQLEng
> ine.java:188
> DSR>> 1)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.fetchRaw(SQLEn
> gine.java:19
> DSR>> 54)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.nextIdentity(S
> QLEngine.jav
> DSR>> a:1762)
> DSR>> at
> DSR>>
> org.exolab.castor.persist.QueryResults.nextIdentity(QueryResul
> ts.java:173)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMo
> re(OQLQueryI
> DSR>> mpl.java:638)
> DSR>> at
> DSR>>
> org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMo
> re(OQLQueryI
> DSR>> mpl.java:624)
> DSR>>
> DSR>>
> DSR>> which seems to be relative to the problem of using
> SimpleDateFormat or a
> DSR>> DateFormat in a multithread environnement
> DSR>> whereas those classes are not thread-safe.
> DSR>> Can somebody familiar with this part of Castor JDO,
> confirm this please ?
> DSR>>
> DSR>I can propose my patch. It works for me, but I'm not sure
> it's the good way
> DSR>to answer the problem. <<patch-castor-sqltypes.txt>>
>
> This is definitely an issue that needs to be addressed
> immediately. I've
> filed bug #1454:
>
> http://bugzilla.exolab.org/show_bug.cgi?id=1454
>
> The problem is fixed in CVS.
>
> Bruce
> --
> perl -e 'print
> unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
>
> The Castor Project
> http://www.castor.org/
>
> Apache Geronimo
> http://incubator.apache.org/projects/geronimo.html
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
I have a look to your code in CVS to handle the bug, and I was
wondering whether it would work because when you do :
new TypeConvertorInfo( new SQLTypeConvertor( java.lang.Integer.class,
java.util.Date.class ) {
public Object convert( Object obj, String param ) {
try {
getParamDateFormat().applyPattern(
org.exolab.castor.mapping.loader.Types.getFullDatePattern( param ) );
return getParamDateFormat().parse( obj.toString() );
} catch ( ParseException except ) {
throw new IllegalArgumentException( except.toString() );
}
}
} ),
You apply a pattern on a clone, then you format with another clone,
is my understanding correct ?
Ce message et toutes les pi�ces jointes (ci-apr�s le "message") sont �tablis �
l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le d�truire et d'en avertir imm�diatement l'exp�diteur.
Toute utilisation de ce message non conforme � sa destination, modification, diffusion
ou toute publication, totale ou partielle, est interdite, sauf autorisation
expresse.FININFO (et ses filiales) d�cline(nt) toute responsabilit� au titre de ce
message, dans l'hypoth�se ou il aurait �t� modifi�, alt�r�, falsifi� ou encore �dit�
ou diffus� sans autorisation.
-----------------------------------------------------
This message and any attachments (the "message") is intended
solely for the addressees and is confidential. If you receive this
message in error, please delete it and immediately notify the
sender. Any use not in accord with its purpose, any dissemination
or disclosure, either whole or partial, is prohibited except formal
approval. Neither FININFO (nor any of its subsidiaries or affiliates)
shall be liable for the message if modified, altered, falsified, edited
or diffused without authorization.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev