- 浏览: 1245164 次
- 性别:
- 来自: 上海
-
文章分类
最新评论
-
lankk:
lankk 写道事实上,在运行String s1=new St ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
事实上,在运行String s1=new String(&qu ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
同意1楼的说法http://docs.oracle.com/j ...
理解String 及 String.intern() 在实际中的应用 -
raoyutao:
...
jdk 线程池 ThreadPoolExecutor -
hongdanning:
理解了。之前困惑的一些明白了。谢谢分享。
理解String 及 String.intern() 在实际中的应用
这个文章的关注点是如何在只准使用servlet jsp jdbc的情况下 加入spring来简化 jdbc代码 事务控制 依赖注入
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>WebFilter</filter-name> <filter-class> org.springframework.web.filter.DelegatingFilterProxy </filter-class> <init-param> <param-name>targetFilterLifecycle</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>WebFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- - Application context definition for JPetStore's business layer. - Contains bean references to the transaction manager and to the DAOs in - dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation"). --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="WebFilter" class="test.spring.WebFilter"> <property name="manageSupport" ref="manageSupport" /> </bean> <bean id="manageSupport" class="test.spring.ManageSupport"> <property name="name" value="bingo" /> <property name="jdbcTemplate" ref="jdbcTemplate"></property> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate"> <constructor-arg> <ref bean="dataSource"/> </constructor-arg> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" /> <property name="url" value="jdbc:jtds:sqlserver://127.0.0.1:1433/xxx" /> <property name="username" value="sa" /> <property name="password" value="sa" /> </bean> </beans>
WebFilter.java
package test.spring; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; public class WebFilter implements Filter { private ManageSupport manageSupport; public void destroy() { // TODO Auto-generated method stub } public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException { System.out.println(getClass().getName() + " filter"); System.out.println(manageSupport.getName()); int count = manageSupport.getJdbcTemplate().queryForInt("SELECT COUNT(*) FROM MESSAGE"); System.out.println(count); arg2.doFilter(arg0, arg1); HttpServletRequest req = (HttpServletRequest) arg0; req.getSession().getServletContext().getRequestDispatcher("/index2.jsp").forward(arg0, arg1); } public void init(FilterConfig arg0) throws ServletException { // TODO Auto-generated method stub } public ManageSupport getManageSupport() { return manageSupport; } public void setManageSupport(ManageSupport manageSupport) { this.manageSupport = manageSupport; } }
ManageSupport.java
package test.spring; import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; public class ManageSupport{ private SimpleJdbcTemplate jdbcTemplate; private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public SimpleJdbcTemplate getJdbcTemplate() { return jdbcTemplate; } public void setJdbcTemplate(SimpleJdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } }
事物控制在spring的sample里有参考
研究了一下事物
改动如下
打算针对ManageSupport做自动事物切入
把ManageSupport重构出接口 用eclipse可以在几秒实现这个
package test.spring; import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; public interface IManageSupport { public abstract String getName(); public abstract void setName(String name); public abstract SimpleJdbcTemplate getJdbcTemplate(); public abstract void setJdbcTemplate(SimpleJdbcTemplate jdbcTemplate); public int logic1(); public void logic2(); }
在实现中的事物逻辑
public int logic1(){ return getJdbcTemplate().queryForInt("SELECT COUNT(*) FROM JB_COM_MESSAGE"); } public void logic2(){ int count=logic1(); for (int i = 1; i <= count; i++) { getJdbcTemplate().update("update JB_COM_MESSAGE set m_level =1 where id=?", i); } }
调用业务方法的方法 WebFilter.java中的
public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException { System.out.println(getClass().getName() + " filter"); System.out.println(manageSupport.getName()); int count = manageSupport.logic1(); System.out.println(count); manageSupport.logic2(); arg2.doFilter(arg0, arg1); HttpServletRequest req = (HttpServletRequest) arg0; req.getSession().getServletContext().getRequestDispatcher("/index2.jsp").forward(arg0, arg1); }
spring配置中 事务相关
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" /> <property name="url" value="jdbc:jtds:sqlserver://127.0.0.1:1433/DSO" /> <property name="username" value="sa" /> <property name="password" value="sa" /> </bean> <aop:config> <aop:advisor pointcut="execution(* test.spring.IManageSupport.*(..))" advice-ref="txAdvice" /> </aop:config> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="logic*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>
最后执行成功 以下是log
test.spring.WebFilter filter [DEBUG] 2009-12-07 10:26:45 [http-8080-Processor25] [org.springframework.transaction.interceptor.TransactionInterceptor.prepareTransactionInfo:300] Don't need to create transaction for [test.spring.IManageSupport.getName]: This method isn't transactional. bingo [DEBUG] 2009-12-07 10:26:45 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.getTransaction:371] Creating new transaction with name [test.spring.IManageSupport.logic1]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT [DEBUG] 2009-12-07 10:26:45 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin:202] Acquired Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] for JDBC transaction [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin:219] Switching JDBC Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] to manual commit [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.bindResource:186] Bound value [org.springframework.jdbc.datasource.ConnectionHolder@6f0962] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.initSynchronization:261] Initializing transaction synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.interceptor.TransactionInterceptor.prepareTransactionInfo:290] Getting transaction for [test.spring.IManageSupport.logic1] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.query:436] Executing SQL query [SELECT COUNT(*) FROM JB_COM_MESSAGE] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@6f0962] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@6f0962] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@6f0962] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.interceptor.TransactionInterceptor.commitTransactionAfterReturning:319] Completing transaction for [test.spring.IManageSupport.logic1] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerBeforeCommit:903] Triggering beforeCommit synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerBeforeCompletion:916] Triggering beforeCompletion synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.processCommit:730] Initiating transaction commit [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit:259] Committing JDBC transaction on Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerAfterCommit:929] Triggering afterCommit synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerAfterCompletion:945] Triggering afterCompletion synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization:315] Clearing transaction synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.doUnbindResource:232] Removed value [org.springframework.jdbc.datasource.ConnectionHolder@6f0962] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] from thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion:314] Releasing JDBC Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] after transaction [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection:312] Returning JDBC Connection to DataSource 6 [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.getTransaction:371] Creating new transaction with name [test.spring.IManageSupport.logic2]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin:202] Acquired Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] for JDBC transaction [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin:219] Switching JDBC Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] to manual commit [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.bindResource:186] Bound value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.initSynchronization:261] Initializing transaction synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.interceptor.TransactionInterceptor.prepareTransactionInfo:290] Getting transaction for [test.spring.IManageSupport.logic2] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.query:436] Executing SQL query [SELECT COUNT(*) FROM JB_COM_MESSAGE] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [1], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [2], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [3], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [4], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [5], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.update:790] Executing prepared SQL update [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.execute:574] Executing prepared SQL statement [update JB_COM_MESSAGE set m_level =1 where id=?] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal:207] Setting SQL statement parameter value: column index 1, parameter value [6], value class [java.lang.Integer], SQL type unknown [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement:800] SQL update affected 1 rows [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.getResource:142] Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] bound to thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.interceptor.TransactionInterceptor.commitTransactionAfterReturning:319] Completing transaction for [test.spring.IManageSupport.logic2] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerBeforeCommit:903] Triggering beforeCommit synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerBeforeCompletion:916] Triggering beforeCompletion synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.processCommit:730] Initiating transaction commit [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit:259] Committing JDBC transaction on Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerAfterCommit:929] Triggering afterCommit synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.triggerAfterCompletion:945] Triggering afterCompletion synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization:315] Clearing transaction synchronization [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.transaction.support.TransactionSynchronizationManager.doUnbindResource:232] Removed value [org.springframework.jdbc.datasource.ConnectionHolder@139a0dc] for key [org.apache.commons.dbcp.BasicDataSource@17e9134] from thread [http-8080-Processor25] [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion:314] Releasing JDBC Connection [jdbc:jtds:sqlserver://127.0.0.1:1433/DSO, UserName=sa, jTDS Type 4 JDBC Driver for MS SQL Server and Sybase] after transaction [DEBUG] 2009-12-07 10:26:46 [http-8080-Processor25] [org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection:312] Returning JDBC Connection to DataSource
发表评论
-
ServiceLocatorFactoryBean 学习
2016-01-27 14:36 3418今天看一个新项目 ... -
连接池exception GetConnectionTimeoutException get/close not same thread
2015-09-24 14:44 7150环境 hibernate 4.2.0.Final sp ... -
jboss Closing a connection for you
2011-05-10 19:06 2082jboss 报了如下的错 [CachedConnect ... -
jersey spring tomcat 集成
2011-05-04 15:39 3644首先把jersey的相关jar放到WEB-INF/lib目录下 ... -
spring 源码阅读之 WebApplicationContext 初始化
2011-03-21 15:32 2285web.xml <listener> ... -
spring security debug 小结
2010-05-21 16:06 2940有时需要在默认的filter之前定义自己的filter来改 ... -
spring security 修改 RememberMeServices的key
2010-05-21 12:11 2165用RememberMe的时候想改一些RememberMeSer ... -
spring security ajax
2010-05-20 16:39 2782转自 http://loianegroner.com/2010 ... -
spring security 自定义过滤器
2010-05-20 13:45 4151Filters 'com.lich0079.services. ... -
web 代码中 如何获得 applicationcontext 及与 beanfactory 区别
2010-05-19 17:18 1989WebApplicationContextUtils.getW ... -
spring aop
2009-12-11 18:35 1473spring对AOP的支持(采用Annotation的方式)1 ... -
spring 初步
2009-12-11 18:34 11381、spring普通属性注入 参见spring文档3.3. ... -
Spring+Ibatis构建多库业务系统(一)
2009-06-17 18:33 1491http://244369.blog.chinajavawor ... -
使用spring发送邮件例
2009-03-04 11:50 2520使用javamail來發送信件的主要流程是由 web serv ...
相关推荐
内容概要:本文详细介绍了基于MATLAB GUI界面和卷积神经网络(CNN)的模糊车牌识别系统。该系统旨在解决现实中车牌因模糊不清导致识别困难的问题。文中阐述了整个流程的关键步骤,包括图像的模糊还原、灰度化、阈值化、边缘检测、孔洞填充、形态学操作、滤波操作、车牌定位、字符分割以及最终的字符识别。通过使用维纳滤波或最小二乘法约束滤波进行模糊还原,再利用CNN的强大特征提取能力完成字符分类。此外,还特别强调了MATLAB GUI界面的设计,使得用户能直观便捷地操作整个系统。 适合人群:对图像处理和深度学习感兴趣的科研人员、高校学生及从事相关领域的工程师。 使用场景及目标:适用于交通管理、智能停车场等领域,用于提升车牌识别的准确性和效率,特别是在面对模糊车牌时的表现。 其他说明:文中提供了部分关键代码片段作为参考,并对实验结果进行了详细的分析,展示了系统在不同环境下的表现情况及其潜在的应用前景。
嵌入式八股文面试题库资料知识宝典-计算机专业试题.zip
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_3.zip
内容概要:本文深入探讨了一款额定功率为4kW的开关磁阻电机,详细介绍了其性能参数如额定功率、转速、效率、输出转矩和脉动率等。同时,文章还展示了利用RMxprt、Maxwell 2D和3D模型对该电机进行仿真的方法和技术,通过外电路分析进一步研究其电气性能和动态响应特性。最后,文章提供了基于RMxprt模型的MATLAB仿真代码示例,帮助读者理解电机的工作原理及其性能特点。 适合人群:从事电机设计、工业自动化领域的工程师和技术人员,尤其是对开关磁阻电机感兴趣的科研工作者。 使用场景及目标:适用于希望深入了解开关磁阻电机特性和建模技术的研究人员,在新产品开发或现有产品改进时作为参考资料。 其他说明:文中提供的代码示例仅用于演示目的,实际操作时需根据所用软件的具体情况进行适当修改。
少儿编程scratch项目源代码文件案例素材-剑客冲刺.zip
少儿编程scratch项目源代码文件案例素材-几何冲刺 转瞬即逝.zip
内容概要:本文详细介绍了基于PID控制器的四象限直流电机速度驱动控制系统仿真模型及其永磁直流电机(PMDC)转速控制模型。首先阐述了PID控制器的工作原理,即通过对系统误差的比例、积分和微分运算来调整电机的驱动信号,从而实现转速的精确控制。接着讨论了如何利用PID控制器使有刷PMDC电机在四个象限中精确跟踪参考速度,并展示了仿真模型在应对快速负载扰动时的有效性和稳定性。最后,提供了Simulink仿真模型和详细的Word模型说明文档,帮助读者理解和调整PID控制器参数,以达到最佳控制效果。 适合人群:从事电力电子与电机控制领域的研究人员和技术人员,尤其是对四象限直流电机速度驱动控制系统感兴趣的读者。 使用场景及目标:适用于需要深入了解和掌握四象限直流电机速度驱动控制系统设计与实现的研究人员和技术人员。目标是在实际项目中能够运用PID控制器实现电机转速的精确控制,并提高系统的稳定性和抗干扰能力。 其他说明:文中引用了多篇相关领域的权威文献,确保了理论依据的可靠性和实用性。此外,提供的Simulink模型和Word文档有助于读者更好地理解和实践所介绍的内容。
嵌入式八股文面试题库资料知识宝典-2013年海康威视校园招聘嵌入式开发笔试题.zip
少儿编程scratch项目源代码文件案例素材-驾驶通关.zip
小区开放对周边道路通行能力影响的研究.pdf
内容概要:本文探讨了冷链物流车辆路径优化问题,特别是如何通过NSGA-2遗传算法和软硬时间窗策略来实现高效、环保和高客户满意度的路径规划。文中介绍了冷链物流的特点及其重要性,提出了软时间窗概念,允许一定的配送时间弹性,同时考虑碳排放成本,以达到绿色物流的目的。此外,还讨论了如何将客户满意度作为路径优化的重要评价标准之一。最后,通过一段简化的Python代码展示了遗传算法的应用。 适合人群:从事物流管理、冷链物流运营的专业人士,以及对遗传算法和路径优化感兴趣的科研人员和技术开发者。 使用场景及目标:适用于冷链物流企业,旨在优化配送路线,降低运营成本,减少碳排放,提升客户满意度。目标是帮助企业实现绿色、高效的物流配送系统。 其他说明:文中提供的代码仅为示意,实际应用需根据具体情况调整参数设置和模型构建。
少儿编程scratch项目源代码文件案例素材-恐怖矿井.zip
内容概要:本文详细介绍了基于STM32F030的无刷电机控制方案,重点在于高压FOC(磁场定向控制)技术和滑膜无感FOC的应用。该方案实现了过载、过欠压、堵转等多种保护机制,并提供了完整的源码、原理图和PCB设计。文中展示了关键代码片段,如滑膜观测器和电流环处理,以及保护机制的具体实现方法。此外,还提到了方案的移植要点和实际测试效果,确保系统的稳定性和高效性。 适合人群:嵌入式系统开发者、电机控制系统工程师、硬件工程师。 使用场景及目标:适用于需要高性能无刷电机控制的应用场景,如工业自动化设备、无人机、电动工具等。目标是提供一种成熟的、经过验证的无刷电机控制方案,帮助开发者快速实现并优化电机控制性能。 其他说明:提供的资料包括详细的原理图、PCB设计文件、源码及测试视频,方便开发者进行学习和应用。
基于有限体积法Godunov格式的管道泄漏检测模型研究.pdf
嵌入式八股文面试题库资料知识宝典-CC++笔试题-深圳有为(2019.2.28)1.zip
少儿编程scratch项目源代码文件案例素材-几何冲刺 V1.5.zip
Android系统开发_Linux内核配置_USB-HID设备模拟_通过root权限将Android设备转换为全功能USB键盘的项目实现_该项目需要内核支持configFS文件系统
C# WPF - LiveCharts Project
少儿编程scratch项目源代码文件案例素材-恐怖叉子 动画.zip
嵌入式八股文面试题库资料知识宝典-嵌⼊式⼯程师⾯试⾼频问题.zip