I have a simple web application developed using Spring, and recently I have been having some problems connecting to the database. My database is on MS SQL Server 2005.
To extract the data, I implemented several DAOs using the JDBCTemplate class provided by the framework.
Sometimes I get this exception:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: StatementCallback; SQL [SELECT [Campaigns].[CampaignID],[CampaignCode],[CampaignType],[StartDate],[EndDate],[Status],[FirstUpdate],[LastUpdate],[FirstUpdateUserID],[LastUpdateUserID],[CampaignDescriptions].[Description] FROM [Campaigns] INNER JOIN [CampaignDescriptions] ON [Campaigns].[CampaignID] = [CampaignDescriptions].[CampaignID] ORDER BY [StartDate] DESC]; Connection reset by peer: socket write error; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
an exception occurs only when the requested request is executed.
I can not understand what causes this problem. Any idea?
Request Execution Method:
@Transactional(propagation = Propagation.NEVER) public Campaign[] getAll() { List<Campaign> campList = getJdbcTemplate() .query(BASE_QUERY, new CampaignMapper()); return campList.toArray(new Campaign[0]); }
where BASE_QUERY matches the exception message.
source share