Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Jdbc > Re: Deadlock wh...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 1907 of 2010
Post > Topic >>

Re: Deadlock while using getNotifications() and Statement.executeQuery()

by joao.leal@[EMAIL PROTECTED] (Joao Rui Leal) Mar 26, 2008 at 10:19 AM

On Tuesday 25 March 2008, Kris Jurka wrote:
> On Tue, 25 Mar 2008, Joao Rui Leal wrote:
> > I did a workaround/hack to fix the problem, but there should be some
> > better way to fix this. I had to make sure that the locking order in
> > getNotifications() is same as in executeQuery(), but that meant
exposing
> > the QueryExecutor in the ProtocolConnection (the QueryExecutorImpl is
> > saved as private variable inside ProtocolConnectionImpl). So I had to
> > make the following changes (it's not pretty, I know...):
>
> I don't see why you need access to the Impl version.  Isn't
"synchronized
> (getQueryExecutor())" around AbstractJdbc2Connection's
> protoConnection.getNotifications() sufficient?

I haven't tested it yet but you seem to be right. I didn't know there was
such 
a method (1st time going through the API). I guess if it returns the  
org.postgresql.core.v3.QueryExecutorImpl object then the locking will be
in 
the same order as in executeQuery().

>
> Still that's not a real clean/understandable design.  Perhaps instead
> processNotifies() should be added to the public QueryExecutor interface
> and then AbstractJdbc2Connection can call processNotifies itself so that
> fetching notifications from protoConnection doesn't require any
> interaction with the QueryExecutor.

I agree.

Joao Leal

>
> Kris Jurka

-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
 




 5 Posts in Topic:
Deadlock while using getNotifications() and Statement.executeQue
joao.leal@[EMAIL PROTECTE  2008-03-24 17:58:06 
Re: Deadlock while using getNotifications() and Statement.execut
joao.leal@[EMAIL PROTECTE  2008-03-25 15:16:15 
Re: Deadlock while using getNotifications() and
books@[EMAIL PROTECTED]   2008-03-25 16:11:52 
Re: Deadlock while using getNotifications() and Statement.execut
joao.leal@[EMAIL PROTECTE  2008-03-26 10:19:38 
Re: Deadlock while using getNotifications() and Statement.execut
books@[EMAIL PROTECTED]   2008-04-01 01:22:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 8:15:05 CDT 2008.