Akshay Rathore wrote:Even if the lock.lock() is not inside the try block it could fail right?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Scott Selikoff wrote:but both of us having a strong database background this "felt" wrong. It would be like opening a database connection outside the try {} block, but still releasing it in a finally {} block.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Scott Selikoff wrote:Because you can't have a finally without a try {} block.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |