You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by David Van Couvering <da...@vancouvering.com> on 2010/04/08 21:00:07 UTC
CREATE TABLE not thread safe on Linux?
Hi, all. Don't ask me why, but I have a stress test that launches 100
simultaneous threads, all of which grab their own connection pool, and send
a CREATE TABLE command to the same Derby database. It ignores exceptions
saying the table is already created.
This works find on Windows. However, on RHEL, I get a lot of nasties - I
get low-level NullPointerException and "operation interrupted" from nio.
Bad news all around.
I then put a global lock around my create table operation, and voila, works.
I don't currently have the time to put together a formal reproduction, but I
thought I should let you know, perhaps it's something somebody wants to
check out - it's pretty easy to write up the test case.
David
--
David W. Van Couvering
http://www.linkedin.com/in/davidvc
http://davidvancouvering.blogspot.com
http://twitter.com/dcouvering
Re: CREATE TABLE not thread safe on Linux?
Posted by David Van Couvering <da...@gmail.com>.
Hm, possibly. I can try the same thing using DriverManager.getConnection()
instead of a connection pool.
On Fri, Apr 9, 2010 at 1:10 AM, Knut Anders Hatlen <Kn...@sun.com>wrote:
> On 04/ 8/10 09:00 PM, David Van Couvering wrote:
> > Hi, all. Don't ask me why, but I have a stress test that launches 100
> > simultaneous threads, all of which grab their own connection pool, and
> > send a CREATE TABLE command to the same Derby database. It ignores
> > exceptions saying the table is already created.
> >
> > This works find on Windows. However, on RHEL, I get a lot of nasties
> > - I get low-level NullPointerException and "operation interrupted"
> > from nio. Bad news all around.
>
> Hi David,
>
> Could the problem be that your connection pool is sending interrupts to
> the executing threads? I vaguely recall cases where connection pools
> have been said to do that kind of things.
>
> --
> Knut Anders
>
>
--
David W. Van Couvering
http://www.linkedin.com/in/davidvc
http://davidvancouvering.blogspot.com
http://twitter.com/dcouvering
Re: CREATE TABLE not thread safe on Linux?
Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
On 04/ 8/10 09:00 PM, David Van Couvering wrote:
> Hi, all. Don't ask me why, but I have a stress test that launches 100
> simultaneous threads, all of which grab their own connection pool, and
> send a CREATE TABLE command to the same Derby database. It ignores
> exceptions saying the table is already created.
>
> This works find on Windows. However, on RHEL, I get a lot of nasties
> - I get low-level NullPointerException and "operation interrupted"
> from nio. Bad news all around.
Hi David,
Could the problem be that your connection pool is sending interrupts to
the executing threads? I vaguely recall cases where connection pools
have been said to do that kind of things.
--
Knut Anders