try..except, try..finally in middle tier

try..except, try..finally in middle tier

Post by Greg Saund » Thu, 15 Dec 2005 05:49:42


Using D6 and Datasnap via COM+ for the middletier.

When should I use the try finally or try except in the middletier? I
asked this mostly in conjuction with me calling server side methods from
the client.

Could someone give some general guidelines for this please?

Basically I want things to close down as clean as possible and be able to
let the user know what failed.

I only anticipate failures while opening tables or posting to a table in
these methods. I don't really seeing much else happening, but I
definitley don't want to leave a bunch of resources open.

Thanks
 
 
 

try..except, try..finally in middle tier

Post by TOndre » Sat, 24 Dec 2005 21:19:14

> Using D6 and Datasnap via COM+ for the middletier.
I

Use try..finally as usual to prevent leaking memory and resources.
Use try..except to handle exceptions you can recover from, or want to
handle specifically.
Unhandled exceptions will be sent back to the client where they will
be re-raised as EOleException with the original message from the
appserver.

HTH
TOndrej