purepennons / gss

Automatically exported from code.google.com/p/gss
Other
0 stars 0 forks source link

TransactionHelper Issue (followed via blog) #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
#1 Pointer to .java file should be updated in blog, took a sec to find

#2 If Nullpointer is thrown, e.getCause() will be null in which case you will 
get Nullpointer in code

May want to say something like if

                    if (cause == null) {
                        throw (Exception) e;
                    }

                    if (cause instanceof Exception) {
                        throw (Exception) cause;
                    }
                    if (cause instanceof Error) {
                        throw (Error) cause;
                    }

Original issue reported on code.google.com by jwein...@gmail.com on 23 Jun 2011 at 4:04

GoogleCodeExporter commented 8 years ago
You are probably referring to this blog 
post:http://blog.astithas.com/2009/06/retrying-transactions-in-java.html right?

The link at the time was: 
http://code.google.com/p/gss/source/browse/src/gr/ebs/gss/server/rest/Transactio
nHelper.java

the class was moved to another package and we then renamed the package tree, so 
the right link is now: 
http://code.google.com/p/gss/source/browse/src/org/gss_project/gss/server/ejb/Tr
ansactionHelper.java

If you are referring to 
http://code.google.com/p/gss/source/browse/src/org/gss_project/gss/server/ejb/Tr
ansactionHelper.java#86 you are right: if e.getCause() == null then line 98 
(http://code.google.com/p/gss/source/browse/src/org/gss_project/gss/server/ejb/T
ransactionHelper.java#98) will throw a null pointer exception. I'm not sure 
though if this can ever happen.

We will check it out more thoroughly. Thanks for taking the time to report it.

Original comment by f.stamat...@ebs.gr on 23 Jun 2011 at 8:08