com.microsoft.sqlserver.jdbc.SQLServerException: 事务(进程 ID 130)与另一个进程已被死锁在 lock 资源上,且该事务已被选作死锁牺牲品。请重新运行该事务。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:390)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:283)
at com.nemo.dao.UserDao.login(UserDao.java:40)
at com.nemo.service.UserService.login(UserService.java:28)
at com.nemo.utils.LoginUtils.login(LoginUtils.java:65)
at com.nemo.utils.LoginUtils.checkUserRequest(LoginUtils.java:143)
at com.nemo.server.ListenerClient.run(ListenerClient.java:63)
====解决====
解决办法:仔细查看错误,由哪个程序文件引起,再查看对应表,在对应表上加上
select * from table1 with(updlock) where ....