Hello,
I have an internal web app. Basically its just a jsp that calls a servlet that calls my DAO Manager classes that uses spring 2.5 jdbc.
My jsp uses AJAX to call the servlet to update a row in a table.
In my servlet i call following method in my DAO class:
Here is how my DAO class is defined in the Application context.Code:public void updatePhysician(PhysicianInfo pi) { String strSQL = "UPDATE provider_tab \n" + "SET wc_active=:wcActive, ds_active=:dsActive\n" + "WHERE rec_id=:id"; Map<String, Object> params = new HashMap<String, Object>(); params.put("wcActive", pi.getWcActive() ); params.put("dsActive", pi.getDsActive() ); params.put("id", pi.getId() ); try { int i = this.simpleJdbcTemplate.update(strSQL, params); logger.info("i is " + i); } catch (Exception e) { e.printStackTrace(); logger.info("EXCEPTION " + e.getMessage()); } }
So basically what is happening is that I can update any row (record) once. When I try and update that same row again making an ajax call it won't update. I'm getting no errors and this is from my logs:Code:<bean id="physicianDAO" scope="request" class="com.whatever.services.PhysicianDBManagerDAO"> <property name="dataSource" ref="dataSource" /> </bean>
2011-06-30 11:15:19,707 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - <Executing prepared SQL update>
2011-06-30 11:15:19,707 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - <Executing prepared SQL statement [UPDATE provider_tab
SET wc_active=?, ds_active=?
WHERE rec_id=?]>
2011-06-30 11:15:19,707 DEBUG [org.springframework.jdbc.datasource.DataSourceUtil s] - <Fetching JDBC Connection from DataSource>
2011-06-30 11:15:19,707 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - <SQL update affected 0 rows>
2011-06-30 11:15:19,707 DEBUG [org.springframework.jdbc.datasource.DataSourceUtil s] - <Returning JDBC Connection to DataSource>
2011-06-30 11:15:19,707 INFO [com.whatever.services.PhysicianDBManagerDAO] - <i is 0>
2011-06-30 11:15:19,707 DEBUG [org.springframework.web.context.request.RequestCon textListener] - <Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@951a0>
I don't know if its caching or what.
Any ideas.
Thanks
-Dan


Reply With Quote