Обсуждение: setQueryTimout()

Поиск
Список
Период
Сортировка

setQueryTimout()

От
knircky
Дата:
I am trying to connect to my postgres db via MashZone (www.mashzone.com) and
getting the following error message:

The following error occurred when running SQL query "SELECT * FROM
GT.GameTypeDescription;" on database "HM_postgres": Method
org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet
implemented.

Since i do not have control over how mashzone communicates with postgres, (i
am simply a user of a product that communicates with the DBMS), i need to
find a JDBC driver that either implements this functionality or catches and
ignores the exception.

I have been unable to find anything so far.

Does anybody have any idea how to solve this dilemma?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/setQueryTimout-tp2856086p2856086.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

Re: setQueryTimout()

От
Samuel Gendler
Дата:
On Mon, Sep 27, 2010 at 5:29 PM, knircky <knircky@gmail.com> wrote:

I am trying to connect to my postgres db via MashZone (www.mashzone.com) and
getting the following error message:

The following error occurred when running SQL query "SELECT * FROM
GT.GameTypeDescription;" on database "HM_postgres": Method
org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet
implemented.
 
[snip]
 
Does anybody have any idea how to solve this dilemma?

 
There may well be a much simpler way, but it is really easy to both read and build the jdbc driver code.  It can't possibly be much work to find where that exception is being thrown and just return instead.  What the side effects of doing so may be on the product is another question entirely.  Don't write long running queries and it shouldn't be a problem, though ;-)
 

Re: setQueryTimout()

От
Samuel Gendler
Дата:


On Mon, Sep 27, 2010 at 9:05 PM, Samuel Gendler <sgendler@ideasculptor.com> wrote:

 
There may well be a much simpler way, but it is really easy to both read and build the jdbc driver code.  It can't possibly be much work to find where that exception is being thrown and just return instead.  What the side effects of doing so may be on the product is another question entirely.  Don't write long running queries and it shouldn't be a problem, though ;-)
 

I also wouldn't be surprised to find out that it is possible to modify mashzone's config in a manner which prevents the call to setQueryTimeout in the first place.  Try explicitly setting the timeout to 0 or -1 or some other value that may imply infinity 

Re: setQueryTimout()

От
knircky
Дата:
unfortunate this is not in my power.....
--
View this message in context: http://postgresql.1045698.n5.nabble.com/setQueryTimout-tp2856086p2856227.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

Re: setQueryTimout()

От
knircky
Дата:
Unfortunately the Query timeout can only be configured via the GUI with 4
possible values ranging from 10-120sec.

I have posted my problem into the MashZone community as well. MashZone has
not been tested with Postgres according to release notes, only with DB2,
ORA, MS and MySQL


http://www.ariscommunity.com/users/knircky/2010-09-27-mashzone-postgres-method-orgpostgresqljdbc4jdbc4statementsetquerytimeoutint-not-yet-implemented
--
View this message in context: http://postgresql.1045698.n5.nabble.com/setQueryTimout-tp2856086p2856225.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

Re: setQueryTimout()

От
Дата:
On Mon, 27 Sep 2010 17:29:13 -0700 (PDT), knircky <knircky@gmail.com>
wrote:
> The following error occurred when running SQL query "SELECT * FROM
> GT.GameTypeDescription;" on database "HM_postgres": Method
> org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet
> implemented.

I posted at the end of 2009 a patch for query timeout implementation on
server side (as we extensively use PostgreSQL)
(http://archives.postgresql.org/pgsql-jdbc/2009-11/msg00010.php), you can
download it and try patching - I will review a code once again, but you can
check, using supplied tests, that this works and what is most important
terminates (!) deadlocked statements.

Kind regards,
Radosław Smogura
http://www.softperience.eu

Re: setQueryTimout()

От
Radosław Smogura
Дата:
On Mon, 27 Sep 2010 17:29:13 -0700 (PDT), knircky <knircky@gmail.com>
wrote:
> The following error occurred when running SQL query "SELECT * FROM
> GT.GameTypeDescription;" on database "HM_postgres": Method
> org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet
> implemented.

I posted at the end of 2009 a patch for query timeout implementation on
server side (as we extensively use PostgreSQL)
(http://archives.postgresql.org/pgsql-jdbc/2009-11/msg00010.php), you can
download it and try patching - I will review a code once again, but you
can
check, using supplied tests, that this works and what is most important
terminates (!) deadlocked statements.

Kind regards,
Radosław Smogura
http://www.softperience.eu