[opennms-devel] About bugs 2261 and 2337

Alejandro Galue <[email protected]>
Newsgroups gmane.network.opennms.bugs
Organization Sync Consultores
Message-ID <[email protected]>
Hello All,

First off all, in my opinion, this two bugs are related 
(same Exception with postgresql and Filters)

I did some tests and now I'm more confused. I add a comment 
on org.opennms.web.event.EventFactory.getEvents to display 
a log message with the generated SQL (just before 
preparedStatement), and add a comment on
org.opennms.web.event.filter.BeforeDateFilter.bindParams, 
to see which parameters is passed to preparedStatement.

The generated SQL is:

jetty.log:2008-03-13 16:00:41,630 INFO  [btpool0-3] 
JettyServer: FILTER_SQL_TEST:           SELECT events.*, 
node.nodelabel, service.servicename             FROM node 
RIGHT OUTER JOIN events               ON (events.nodeid = 
node.nodeid)  LEFT OUTER JOIN service               ON 
(service.serviceid = events.serviceid)            WHERE 
EVENTACKUSER IS NULL AND EVENTTIME < to_timestamp(?, ?) AND 
EVENTDISPLAY='Y'  ORDER BY EVENTID DESC LIMIT 10 OFFSET 0

and, the parameters to bind are:

jetty.log:2008-03-13 16:00:41,630 INFO  [btpool0-3] 
JettyServer: FILTER_SQL_TEST: Thu Mar 13 16:00:00 VET 2008, 
'Dy Mon DD HH24:MI:SS Tz YYYY'

If I manually edit the SQL and run it directly on 
postgresql, it works. The query was:

SELECT events.*, node.nodelabel, service.servicename 
       FROM node RIGHT OUTER JOIN events               ON 
(events.nodeid = node.nodeid)  LEFT OUTER JOIN service 
           ON (service.serviceid = events.serviceid) 
      WHERE  EVENTACKUSER IS NULL AND EVENTTIME < 
to_timestamp('Thu Mar 13 16:00:00 VET 2008', 'Dy Mon DD 
HH24:MI:SS Tz YYYY') AND EVENTDISPLAY='Y'  ORDER BY EVENTID 
DESC LIMIT 10 OFFSET 0

So, if the syntax are write, the problem could be the 
binding or the postgresql driver.

I modified EventConstants.POSTGRES_DATE_FORMAT to remove 
quotes, but the log still show me the quotes (and yes, I 
generate a new opennms-services jar, overwrite the old one 
on opennms/lib and restart opennms).

What is happening here?

Regards,
Alejandro.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.