This content has been marked as final.
Show 6 replies
-
1. Re: handling errors and exceptions in a CRUD app
lightguard Dec 21, 2010 4:01 PM (in response to derekw.dweston.abmigroup.com)The best way I've found to do this (until Seam Catch unwraps SQLExceptions, watch for it, coming out soon :) ) is to debug the application, then call the method to see the actual error coming from the DB. It may also be nested (you may have to keep calling getNextException()).
This pretty much stems from SQLExceptions being different from every other exception in the JDK. Instead of wrapping the exception from the DB (new SQLException(Message, [root DB Exception]) it creates a chain of exceptions inside the SQLException which you have to pull out manually. It's very annoying to say the least.
With Seam Catch, you'll be able to see the actual exception from the DB at the top (assuming you create a handler to log the exceptions). -
2. Re: handling errors and exceptions in a CRUD app
derekw.dweston.abmigroup.com Dec 21, 2010 4:58 PM (in response to derekw.dweston.abmigroup.com)
Jason Porter wrote on Dec 21, 2010 16:01:
The best way I've found to do this (until Seam Catch unwraps SQLExceptions, watch for it, coming out soon :) ) is to debug the application, then call the method to see the actual error coming from the DB. It may also be nested (you may have to keep calling getNextException()).
This pretty much stems from SQLExceptions being different from every other exception in the JDK. Instead of wrapping the exception from the DB (new SQLException(Message, root DB Exception) it creates a chain of exceptions inside the SQLException which you have to pull out manually. It's very annoying to say the least.
With Seam Catch, you'll be able to see the actual exception from the DB at the top (assuming you create a handler to log the exceptions).Thanks... just have to figure out how to get debug going now ;)
-
3. Re: handling errors and exceptions in a CRUD app
lightguard Dec 21, 2010 5:39 PM (in response to derekw.dweston.abmigroup.com)You could wrap this call in a try/catch(SQLException e) and go from there :)
-
4. Re: handling errors and exceptions in a CRUD app
derekw.dweston.abmigroup.com Jan 4, 2011 4:51 PM (in response to derekw.dweston.abmigroup.com)
Jason Porter wrote on Dec 21, 2010 17:39:
You could wrap this call in a try/catch(SQLException e) and go from there :)This is where I'm a bit confused. Seems the code I'd want to put that around isn't accessible to me.
(part of the seam entity generated code I don't see) -
5. Re: handling errors and exceptions in a CRUD app
lightguard Jan 4, 2011 5:16 PM (in response to derekw.dweston.abmigroup.com)This is Seam 2 or Seam 3 stuff?
-
6. Re: handling errors and exceptions in a CRUD app
derekw.dweston.abmigroup.com Jan 4, 2011 5:22 PM (in response to derekw.dweston.abmigroup.com)
Jason Porter wrote on Jan 04, 2011 17:16:
This is Seam 2 or Seam 3 stuff?Oh shoot. I screwed up. This is seam 2.2
Of course, I should probably just go to seam 3 on that note... haven't deployed anything important yet.