RE: [Hibernate] QuerySyntaxException not always serializable
No, as when this happens its deep in some serialization stack that has no ability to know that an improperly written subclass can be safely replaced with an instance of its baseclass. This is definitely a bug in antlr and a common mistake since the contract for Serializable was is often introduced several baseclasses away. The hibernate base exception has this semantic knowledge, but its just a hack around the broken antlr exception. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Max Rydahl Andersen > Sent: Thursday, September 08, 2005 9:10 AM > To: Emmanuel Bernard; Hibernate development > Subject: Re: [Hibernate] QuerySyntaxException not always serializable > > > We should report it to Antlr. > ... > Regarding culling of these exceptions isn't that something > appserers actually can do in their serialization code ? > (maybe keeping it Hibernate would be better to be more portable) > > > /max > --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] QuerySyntaxException not always serializable
We should report it to Antlr. Regarding exceptions it would be good if we started adding some more value to these exceptions - it would be so much better if I actually could get the line/column numbers as getters on the QuerySyntaxException. The same goes with many of our other exceptions where I would need to parse (it at all possible) to report a sensible error to the ant-task/plugin user. Anyone who objects to me starting adding this to some of our exceptions (and possible create more specific exception subclasses) ? Regarding culling of these exceptions isn't that something appserers actually can do in their serialization code ? (maybe keeping it Hibernate would be better to be more portable) /max This is nicer. By design an exception is Serializable. It's a contract break from antlr. So the breaking exception list has to be manually maintained. Steve Ebersole wrote: A simpler solution would be to just add a writeObject() impl to HibernateException which culls the cause if it is not serializable (either to null or some "marker"). This would be all encompassing. Plus it would still allow the cause to be known (so long as no attempt is made to serialize it). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Thursday, September 08, 2005 9:05 AM To: Hibernate development Subject: [Hibernate] QuerySyntaxException not always serializable To be more specific, RecognitionException the cause exception may be not Serializable (eg antlr.NoViableAltException (AST and Token are not serializable) Thus JBoss or any remote capable system clashes on remote calls. Is it OK if we do not propagate the cause exception? ie public QuerySyntaxException(RecognitionException e) { super( e.getMessage() + ( ( e.getLine() > 0 && e.getColumn() > 0 ) ? ( " near line " + e.getLine() + ", column " + e.getColumn() ) : "" ), *null* ); //instead of e } Or do we consider Hibernate exceptions as not Serializable? --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] QuerySyntaxException not always serializable
This is nicer. By design an exception is Serializable. It's a contract break from antlr. So the breaking exception list has to be manually maintained. Steve Ebersole wrote: A simpler solution would be to just add a writeObject() impl to HibernateException which culls the cause if it is not serializable (either to null or some "marker"). This would be all encompassing. Plus it would still allow the cause to be known (so long as no attempt is made to serialize it). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Thursday, September 08, 2005 9:05 AM To: Hibernate development Subject: [Hibernate] QuerySyntaxException not always serializable To be more specific, RecognitionException the cause exception may be not Serializable (eg antlr.NoViableAltException (AST and Token are not serializable) Thus JBoss or any remote capable system clashes on remote calls. Is it OK if we do not propagate the cause exception? ie public QuerySyntaxException(RecognitionException e) { super( e.getMessage() + ( ( e.getLine() > 0 && e.getColumn() > 0 ) ? ( " near line " + e.getLine() + ", column " + e.getColumn() ) : "" ), *null* ); //instead of e } Or do we consider Hibernate exceptions as not Serializable? --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] QuerySyntaxException not always serializable
A simpler solution would be to just add a writeObject() impl to HibernateException which culls the cause if it is not serializable (either to null or some "marker"). This would be all encompassing. Plus it would still allow the cause to be known (so long as no attempt is made to serialize it). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Thursday, September 08, 2005 9:05 AM To: Hibernate development Subject: [Hibernate] QuerySyntaxException not always serializable To be more specific, RecognitionException the cause exception may be not Serializable (eg antlr.NoViableAltException (AST and Token are not serializable) Thus JBoss or any remote capable system clashes on remote calls. Is it OK if we do not propagate the cause exception? ie public QuerySyntaxException(RecognitionException e) { super( e.getMessage() + ( ( e.getLine() > 0 && e.getColumn() > 0 ) ? ( " near line " + e.getLine() + ", column " + e.getColumn() ) : "" ), *null* ); //instead of e } Or do we consider Hibernate exceptions as not Serializable? --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel