嗨,我正在无限循环中连续不断地从逻辑复制流中读取数据。我有另一个程序正在不断地填充同一数据库中的表。我注意到一段时间后(大约5-10分钟)。我总是有例外
package com.sanju.p1;
//webfault and namespace
@WebFault(name = "getPreAHistFlt", targetNamespace = "http://www.getPreAuthorizationHistory")
public class getPreAHistFltMsg extends Exception {
private com.sanju.p2.GetPreAHistFlt getPreAHistFlt; // showing bug here
//constructors
public getPreAHistFltMsg() {
super();
}
public getPreAHistFltMsg(String message) {
super(message);
}
public getPreAHistFltMsg(String message, Throwable cause) {
super(message, cause);
}
public getPreAHistFltMsg(String message, com.sanju.p2.GetPreAHistFlt getPreAHistFlt) {
super(message);
this.getPreAHistFlt = getPreAHistFlt;
}
public getPreAHistFltMsg(String message, com.sanju.p2.GetPreAHistFlt getPreAHistFlt, Throwable cause) {
super(message, cause);
this.getPreAHistFlt = getPreAHistFlt;
}
public com.sanju.p2.GetPreAHistFlt getFaultInfo() {
return this.getPreAHistFlt;
}
}
这是我的示例程序:
org.postgresql.util.PSQLException: Database connection failed when reading from copy
at org.postgresql.core.v3.QueryExecutorImpl.readFromCopy(QueryExecutorImpl.java:1035)
at org.postgresql.core.v3.CopyDualImpl.readFromCopy(CopyDualImpl.java:41)
at org.postgresql.core.v3.replication.V3PGReplicationStream.receiveNextData(V3PGReplicationStream.java:155)
at org.postgresql.core.v3.replication.V3PGReplicationStream.readInternal(V3PGReplicationStream.java:124)
at org.postgresql.core.v3.replication.V3PGReplicationStream.read(V3PGReplicationStream.java:70)
at com.datamirror.ts.scrapers.postgresqlscraper.PGStreamReceiver.main(PGStreamReceiver.java:60)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:220)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
at org.postgresql.core.PGStream.receiveChar(PGStream.java:293)
at org.postgresql.core.v3.QueryExecutorImpl.processCopyResults(QueryExecutorImpl.java:1077)
at org.postgresql.core.v3.QueryExecutorImpl.readFromCopy(QueryExecutorImpl.java:1033)
}
任何帮助都值得赞赏!!我正在使用postgres JDBC驱动程序42.2.2。