Abishek N
2011-05-05 17:05:09 UTC
What are the pointers while exception handling in ml? One of the pointers
we have already heard is
"Reduce the use of try/catch where applicable. This is especially true in
situations where try/catch blocks may be nested. Try/catch blocks have a
negative impact on performance due to the fact that the block must be
completely evaluated before the server can move on. "
So does this mean that we have to avoid having try catch blocks around lots
of lines of code? and try to keep the try catch block as short as
possible..
So in the eg. below statement 3 try catch block would not be triggered until
the statement 1 and statement 2 get executed, is that correct? Since
statement 2 is outside try catches there is a possibility it could get lazy
evaluated.
try {
statement 1
}
catch{
}
statement 2
try {
statement 3
}
catch{
}
Similarly in the below scenario.. if we have nested try catches like
below... statement 5 would not get executed until statement 1,2,3 get
executed.. however statement 4 could get executed..
try {
try
{
statement 1
}
catch{
}
statement 2
try {
statement 3
}
catch{
}
}
statement 4
try {
statement 5
}
catch{
}
Please confirm if our understanding is correct.
Regards Abishek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20110505/57a4b0ca/attachment.html
we have already heard is
"Reduce the use of try/catch where applicable. This is especially true in
situations where try/catch blocks may be nested. Try/catch blocks have a
negative impact on performance due to the fact that the block must be
completely evaluated before the server can move on. "
So does this mean that we have to avoid having try catch blocks around lots
of lines of code? and try to keep the try catch block as short as
possible..
So in the eg. below statement 3 try catch block would not be triggered until
the statement 1 and statement 2 get executed, is that correct? Since
statement 2 is outside try catches there is a possibility it could get lazy
evaluated.
try {
statement 1
}
catch{
}
statement 2
try {
statement 3
}
catch{
}
Similarly in the below scenario.. if we have nested try catches like
below... statement 5 would not get executed until statement 1,2,3 get
executed.. however statement 4 could get executed..
try {
try
{
statement 1
}
catch{
}
statement 2
try {
statement 3
}
catch{
}
}
statement 4
try {
statement 5
}
catch{
}
Please confirm if our understanding is correct.
Regards Abishek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20110505/57a4b0ca/attachment.html