Projects tigase _server server-core Issues #36
postgres: setQueryTimeout not implemented (#36)
Closed
tom quas opened 1 decade ago

5.1b2 fails to start w/ the following logs:

2011-03-16 15:09:23 StanzaReceiver.setProperties() SEVERE: Can't initialize repository:

tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:postgresql://localhost/tigasedb?user=xxx&password=yyy&autoCreateUser=true

    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:702)

    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)

    at tigase.server.sreceiver.StanzaReceiver.setProperties(StanzaReceiver.java:643)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:827)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:196)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:75)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:127)

    at tigase.server.MessageRouter.addComponent(MessageRouter.java:123)

    at tigase.server.MessageRouter.addRouter(MessageRouter.java:163)

    at tigase.server.MessageRouter.setProperties(MessageRouter.java:662)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:827)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:196)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:75)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:127)

    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:149)

    at tigase.server.MessageRouter.setConfig(MessageRouter.java:562)

    at tigase.server.XMPPServer.main(XMPPServer.java:135)

Caused by: org.postgresql.util.PSQLException: Method org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int) is not yet implemented.

    at org.postgresql.Driver.notImplemented(Driver.java:753)

    at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:654)

    at tigase.db.jdbc.DataRepositoryImpl.initPreparedStatements(DataRepositoryImpl.java:287)

    at tigase.db.jdbc.DataRepositoryImpl.initRepo(DataRepositoryImpl.java:317)

    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:206)

    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:215)

    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:669)

    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)

    at tigase.server.sreceiver.StanzaReceiver.setProperties(StanzaReceiver.java:643)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:827)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:196)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:75)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:127)

    at tigase.server.MessageRouter.addComponent(MessageRouter.java:123)

    at tigase.server.MessageRouter.addRouter(MessageRouter.java:163)

    at tigase.server.MessageRouter.setProperties(MessageRouter.java:662)

    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:827)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:196)

    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:75)

    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:127)

    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:149)

    at tigase.server.MessageRouter.setConfig(MessageRouter.java:562)

    at tigase.server.XMPPServer.main(XMPPServer.java:135)

i replaced the postgres driver of the original 5.1b2 tarball with the ones from the postgres jdbc download page. tried both jdbc3 and jdbc4 drivers w/o success.

environment: ubuntu lucid, postgres 8.4

Artur Hefczyc commented 1 decade ago

This error is caused but recently added code setting DB query timeout: setQueryTimeout(int) as an attempt to solve problem with stale DB connections or a very long queries which slowdown the server.

Apparently the postgreSQL driver does not yet support these settings.

Therefore the task would be to:

  1. Research whether this or any other similar functionality is provided by any PostgreSQL JDBC driver

  2. Modify the code accordingly, part of which would be detection if this is is postgresql database (or better yet if this functions are supported by the jdbc driver) and then call them or not.

Artur Hefczyc commented 1 decade ago

Code updated, testing now...

tom quas commented 1 decade ago

Artur Hefczyc wrote:

Code updated, testing now...

hi artur, did the tests go well? when are you planning to release a 3rd beta?

tom quas commented 1 decade ago

Artur Hefczyc wrote:

Code updated, testing now...

hi artur, did the tests go well? when are you planning to release a 3rd beta?

Artur Hefczyc commented 1 decade ago

Waiting for final tests or confirmation from the user...

issue 1 of 1
Type
Bug
Priority
Blocker
Assignee
RedmineID
82
Version
tigase-server-5.1.0
Spent time
12h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#36
Please wait...
Page is in error, reload to recover