请教jdbcException:无法从套接字读取更多的数据 怎样解决
本程序是通过hibernate进行的分页代码如下:Javacodequery.setFirstResult(getStartOfPage(start,pageSize))...
本程序是通过hibernate进行的分页
代码如下:
Java codequery.setFirstResult(getStartOfPage(start, pageSize));
query.setMaxResults(pageSize);
list = (List) query.list();
断点进行到query.list()时报以下异常:
================select u.ID,u.userCode,u.userName,d.departmentname from SysLedgerprivilege l,SysUser u,SysDepartment d where u.userDepartmentid= d.ID and l.userid=u.ID and l.ledgerid=2 and u.userState= 0 order by u.ID
Hibernate: select * from ( select sysuser1_.ID as col_0_0_, sysuser1_.USERCODE as col_1_0_, sysuser1_.USERNAME as col_2_0_, sysdepartm2_.DEPARTMENTNAME as col_3_0_ from SYSLEDGERPRIVILEGE sysledgerp0_, SYSUSER sysuser1_, SYSDEPARTMENT sysdepartm2_ where sysuser1_.USERDEPARTMENTID=sysdepartm2_.ID and sysledgerp0_.USERID=sysuser1_.ID and sysledgerp0_.LEDGERID=2 and sysuser1_.USERSTATE=0 order by sysuser1_.ID ) where rownum <= ?
2009-03-03 12:46:07,984 WARN JDBCExceptionReporter - <SQL Error: 17410, SQLState: null>
2009-03-03 12:46:07,984 ERROR JDBCExceptionReporter - <无法从套接字读取更多的数据>
请高手赐教,谢谢。
ps:“================”后为我个人打印的本地sql,然后通过程序转换为“hibernate:”后的hql。
但是这条语句在plsql中查询报错:ora-03113:end-of-file on communication channel。
请问这段hql在哪块出了问题,如何修改,万分感谢。
我的控制台中都打出来了,
sql:select u.ID,u.userCode,u.userName,d.departmentname from SysLedgerprivilege l,SysUser u,SysDepartment d where u.userDepartmentid= d.ID and l.userid=u.ID and l.ledgerid=2 and u.userState= 0 order by u.ID
通过hibernate转换后的hql:
select * from ( select sysuser1_.ID as col_0_0_, sysuser1_.USERCODE as col_1_0_, sysuser1_.USERNAME as col_2_0_, sysdepartm2_.DEPARTMENTNAME as col_3_0_ from SYSLEDGERPRIVILEGE sysledgerp0_, SYSUSER sysuser1_, SYSDEPARTMENT sysdepartm2_ where sysuser1_.USERDEPARTMENTID=sysdepartm2_.ID and sysledgerp0_.USERID=sysuser1_.ID and sysledgerp0_.LEDGERID=2 and sysuser1_.USERSTATE=0 order by sysuser1_.ID ) where rownum <= ?
?应该是10 展开
代码如下:
Java codequery.setFirstResult(getStartOfPage(start, pageSize));
query.setMaxResults(pageSize);
list = (List) query.list();
断点进行到query.list()时报以下异常:
================select u.ID,u.userCode,u.userName,d.departmentname from SysLedgerprivilege l,SysUser u,SysDepartment d where u.userDepartmentid= d.ID and l.userid=u.ID and l.ledgerid=2 and u.userState= 0 order by u.ID
Hibernate: select * from ( select sysuser1_.ID as col_0_0_, sysuser1_.USERCODE as col_1_0_, sysuser1_.USERNAME as col_2_0_, sysdepartm2_.DEPARTMENTNAME as col_3_0_ from SYSLEDGERPRIVILEGE sysledgerp0_, SYSUSER sysuser1_, SYSDEPARTMENT sysdepartm2_ where sysuser1_.USERDEPARTMENTID=sysdepartm2_.ID and sysledgerp0_.USERID=sysuser1_.ID and sysledgerp0_.LEDGERID=2 and sysuser1_.USERSTATE=0 order by sysuser1_.ID ) where rownum <= ?
2009-03-03 12:46:07,984 WARN JDBCExceptionReporter - <SQL Error: 17410, SQLState: null>
2009-03-03 12:46:07,984 ERROR JDBCExceptionReporter - <无法从套接字读取更多的数据>
请高手赐教,谢谢。
ps:“================”后为我个人打印的本地sql,然后通过程序转换为“hibernate:”后的hql。
但是这条语句在plsql中查询报错:ora-03113:end-of-file on communication channel。
请问这段hql在哪块出了问题,如何修改,万分感谢。
我的控制台中都打出来了,
sql:select u.ID,u.userCode,u.userName,d.departmentname from SysLedgerprivilege l,SysUser u,SysDepartment d where u.userDepartmentid= d.ID and l.userid=u.ID and l.ledgerid=2 and u.userState= 0 order by u.ID
通过hibernate转换后的hql:
select * from ( select sysuser1_.ID as col_0_0_, sysuser1_.USERCODE as col_1_0_, sysuser1_.USERNAME as col_2_0_, sysdepartm2_.DEPARTMENTNAME as col_3_0_ from SYSLEDGERPRIVILEGE sysledgerp0_, SYSUSER sysuser1_, SYSDEPARTMENT sysdepartm2_ where sysuser1_.USERDEPARTMENTID=sysdepartm2_.ID and sysledgerp0_.USERID=sysuser1_.ID and sysledgerp0_.LEDGERID=2 and sysuser1_.USERSTATE=0 order by sysuser1_.ID ) where rownum <= ?
?应该是10 展开
展开全部
在HQL里面加一下锁试试 类似sql里面 sql语句加“for update”那样
用下面这句,加个悲观锁试试
query.setLockMode("user",LockMode.UPGRADE); // 加锁 user是表吧
用下面这句,加个悲观锁试试
query.setLockMode("user",LockMode.UPGRADE); // 加锁 user是表吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
TableDI
2024-07-18 广告
2024-07-18 广告
`VLOOKUP` 匹配出错误的数据通常是由于以下几个原因:1. **查找值错误**:输入的查找值与数据源中的值不匹配,可能是因为拼写错误、大小写不一致或存在不可见的字符。2. **查找区域设置错误**:查找区域的首列必须包含要查找的值,且...
点击进入详情页
本回答由TableDI提供
展开全部
我觉得你应该先检查空指针错误,既然SQL语句都写错来了,那么query是能执行通过的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Oracle无法从套接字读取更多的数据的解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是查询语句或是参数设置的问题,把你写的hql贴出来
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询