Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
Some database servers like MySQL may terminate open client connections after some interval (MySQL default is 8 hours). To keep alive long-term connections, D2R can be configured to periodically run "noop" queries. This feature can be enabled with the special property jdbc:keepAlive. An example is given below:

@prefix jdbc: <http://d2rq.org/terms/jdbc/> .

map:database a d2rq:Database;
# ... other database configuration ...
jdbc:keepAlive "3600"; # value in seconds
jdbc:keepAliveQuery "SELECT 1"; # (optionally to override default noop query)
.

By default the noop query is “SELECT 1”, which may not work with some DBMS. For this purpose, the default query may be overridden with a custom noop query.

Regards,
Srikar

On Aug 21, 2014, at 11:56 AM, Torsten Eid <***@lilly.com<mailto:***@lilly.com>> wrote:

Hello,

I am faced with occasional problems when accessing D2RQ server. It seems that the connection to the DB is lost.
The start page for the D2R projects can still be access (so tomcat showing it) , but drilling down into “data” results in a HTTP 500.

Looks like the db connection is lost , error message is : de.fuberlin.wiwiss.d2rq.D2RQException: No more data to read from socket

This happens to occasionally to oracle db’s using an oracle jdbc driver , and much more frequently to a MS SQL DB connected where we use the latest jtds driver. All D2R endpoints run under same tomcat instance. using D2RQ version 0.8 under a linux tomcat, system runs 24/7

if this problem occurs the log shows this (I renamed table names for this post):

19:15:06 INFO Servlet :: Service URI = <sparql>
19:15:06 INFO SPARQL :: Query: SELECT ?s WHERE {?s ?p ?o} LIMIT 1
19:15:06 INFO SPARQL :: JenaException: I/O Error: Connection reset: SELECT DISTINCT "ABC"."CDE"."FGH" FROM "
KLMOP"."Reason" (E0)
19:15:06 INFO ResponseHttp :: Error: URI = sparql : I/O Error: Connection reset: SELECT DISTINCT "ABC"."CDE"."FGH"
FROM "LMNOP"."Reason" (E0)
19:15:06 WARN Servlet :: Internal server error
de.fuberlin.wiwiss.d2rq.D2RQException: Invalid state, the Connection object is closed.; query was: SELECT DISTINCT "ABC"."FGH"."
ReasonId" FROM "ABC"."RFGH" (E0)
at de.fuberlin.wiwiss.d2rq.sql.QueryExecutionIterator.close(QueryExecutionIterator.java:114)
at de.fuberlin.wiwiss.d2rq.optimizer.iterators.RelationToBindingsD2RQIterator$StagePattern.closeIterator(RelationToBindingsD2RQIt
erator.java:203)


Any thougths / suggestions welcome. (Bouncing the tomcat is a workaround but not a good solution.)

Thx in advance
Torsten

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/_______________________________________________
d2rq-map-devel mailing list
d2rq-map-***@lists.sourceforge.net<mailto:d2rq-map-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


--_000_7FCE373AEC964C31BB24EFF35FD0A690emailscedu_
Content-Type: text/html; charset="Windows-1252"
Content-ID: <***@namprd02.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<h3 id="keep-alive" style="clear: right; margin: 2.3em 0px 0.8em;"><span style="color: rgb(0, 90, 156); font-family: sans-serif; font-weight: 300; line-height: 25.600000381469727px; font-size: 12px;">
Loading...