小编Val*_*uri的帖子

Jetty 8.1.0 和 BTM 的数据库异常

我们正在使用 BTM 2.1.2 运行 Jetty 8.1.0。

我们使用 Postgres 作为我们的数据库。

一切都很好,除了当我们在某个表的主要=空的条件下运行任何查询时,服务器会失去与数据库的连接。以下是我们看到的异常:

org.postgresql.util.PSQLException:错误:整数的无效输入语法:“null”
at
...
...长堆栈转储随之而来...
...
2012 年 6 月 15 日下午 12:20:19 org.eclipse。 jetty.server.AsyncHttpConnection 句柄信息:EndPoint 不长进度:stack 100dump SCEP@162b333{l(/74.93.245.209:60506)<->r(/10ensues.99.21.87:80),d=true,open=true ,ishut=false,oshut=false,rb=false,wb=false,w=false,i=5r}-{AsyncHttpConnection@18fc7ca,g=HttpGenerator{s=3,h=-1,b=20909,c= -1},p=HttpParser{s=0,l=16,c=0},r=1} AsyncHttpConnection@18fc7ca,g=HttpGenerator{s=3,h=-1,b=20909,c=-1 },p=HttpParser{s=0,l=16,c=0},r=1 2012 年 6 月 15 日下午 12:20:19
org.eclipse.jetty.server.AsyncHttpConnection 句柄警告:关闭端点没有任何进展:200 SCEP@162b333{l(/74.93.245.209:60506)<->r(/10.99.21.87:80),d=true,open =true,ishut=false,oshut=false,rb=false,wb=false,w=false,i=5r}-{AsyncHttpConnection@18fc7ca,g=HttpGenerator{s=3

此事件后的任何查询均会因以下异常而中断

它发生在我们的生产服务器上!是什么导致了这个问题?

更新:

这是代码!

我知道我们不应该使用 primarykey = null 查询,因为 primary 永远不能为 null。但是它的参数和空验证被遗漏了!

令人惊讶的是,Jetty 6 与它配合得很好!即使在运行此查询之后,它也完全没有问题。它只是 Jetty 8-1-0,在运行此类查询时永久丢失数据库连接。直到我重新启动服务器

String query = "select * from table where primarykey="+parameter; 
Statement lStatement   = null;  
Connection lConnection  = null;  
ResultSet lResultSet   = …
Run Code Online (Sandbox Code Playgroud)

postgresql

5
推荐指数
1
解决办法
473
查看次数

标签 统计

postgresql ×1