0

我正在尝试从位于数据中心的 My DB 接收通知。当我在与数据库相同的网络上时,我可以收到通知,但是当通过 VPN 连接时,没有通知。谁能告诉我如何通过 VPN 收听 AQ。

4

2 回答 2

0

Maybe you should use TCP keeplalive to periodically "refresh" status of your DB connection.

See: http://www.coderanch.com/t/207410/sockets/java/Java-Oracle-JDBC-Linux-KeepAlive https://rubyorchard.wordpress.com/2007/04/07/oracle-jdbc-connection-keepalive/

But you will also need Administrator/root privileges to perform the OS level configuration part.

Another option (preferred) would be listening with timeout. So your code will contain an infinite loop and will handle (ingnore) ORA-25228 error.

于 2015-02-26T13:06:38.593 回答
0

使用 Oracle JDBC Thin 驱动程序,当您调用 connection.registerAQNotification 时,您可以设置全局选项(第三个参数),其中一个选项是本地主机的 IP 地址(OracleConnection.NTF_LOCAL_HOST)。通过 VPN 连接时,您需要将此选项设置为您通过 VPN 的 IP 地址。

于 2015-02-26T23:39:52.127 回答