-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Syed,
On 6/8/2009 1:57 PM, syed shah wrote: > I want to do this cause i am handling the synchronization myself How are you managing the synchronization yourself? What needs to be protected? Why can't you simply use synchronized access to a shared resource and trust that the JVM will do its job properly? > and infact i am using innodb so i dont want multiple instance of the > servlet, although i can handle multiple threads in there. The use of InnoDB does not seem relevant, here. Even if it were, InnoDB is entirely threadsafe... otherwise it would be a pretty poor RDBMS storage engine. > I just wrote some code thats pretty similar to yours except that i > use a int and check if its >1, also you increment it in the > constructor that's neat, i do it in the initialize. Well, you said you didn't want multiple instances. Throwing an exception in the constructor will certainly prevent that object from being used. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkoulZUACgkQ9CaO5/Lv0PB8gwCcDJAeSfdyte5jYhOt9nzKUGlp dB4AoKDSz/e+ujbOramwl8qIiAlknMJw =LMSE -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org