From: Guillermo.Acilu@... Date: 2008-07-15T21:35:30+09:00 Subject: Handling exceptions in Threads --=_alternative 00459655C1257487_= Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hello guys, I have made an multithreaded algorithm that triggers around a hundred=20 concurrent threads. I have in fact, two versions of the same algorithm,=20 one with threads and another with recursive calls. Each thread execute a query on an Oracle database and according to the=20 data, it either calls a new thread and ends, or it stores the result in a=20 global array. The recursive version follow the same process, but instead=20 or running in parallel, it calls the method over and over sequentially. The recursive version runs perfectly and it ends without problem. The=20 multithreaded version fails with an exception that I am not able to=20 identify. If I leave the Thread.abort=5Fon=5Fexception =3D false, the algorithm ends = after=20 triggering about 10 threads. If I set it to Thread.abort=5Fon=5Fexception = =3D=20 true, the algorithm end abnormally, but without printing any error=20 message. I have added the following code at the end of the method called by the=20 thread: rescue Exception =3D> error puts "#{error.class}: #{error.message}" But I cannot get any error message in the console. I am sure that the=20 problem is something related with the database, but I do not know how to=20 solve the problem if I do not see the error message. Any ideas? --- Guillermo Acilu Senior Engineer, Koiaka GmbH Koiaka GmbH Riesserkopfstr. 17=20 82467 Garmisch-Partenkirchen Tel: +49 (0)8821 9679555=20 Fax: +49 (0)8821 730 9185=20 Mailto:guillermo.acilu@koiaka.com http://www.koiaka.com Amtsgericht M=FCnchen: HR B 161 041=20 Gesch=E4ftsf=FChrer: Guillermo Acilu=20 Sitz: Garmisch-Partenkirchen Diese Email kann vertrauliche und/oder rechtlich gesch=FCtzte Informationen= =20 enthalten. Wenn Sie nicht der richtige Adressat sind oder diese Email=20 irrt=FCmlich erhalten haben, d=FCrfen Sie diese weder benutzen, kopieren,=20 weiterleiten oder irgend eine Ma=DFnahme einleiten, die im Zusammenhang mit= =20 dem Inhalt dieser Email steht. Informieren Sie bitte sofort den Absender=20 und vernichten Sie die irrt=FCmlich erhaltene Email vollst=E4ndig. Vielen Dank! This e-mail message may contain confidential and/or privileged=20 information. If you are not an addressee or otherwise authorized to=20 receive this message, you should not use, copy, disclose or take any=20 action based on this e-mail or any information contained in the message.=20 If you have received this material in error, please advise the sender=20 immediately by reply e-mail and delete this message completely. Thank you! --=_alternative 00459655C1257487_=--