2011-10-02 323 views
0

我在JDK 1.6的Tomcat 6中使用Spring 3.0.6。我使用Spring引用爲Spring JDBC配置了聲明式事務。我在日誌中看到我的刪除查詢中的下列內容,但執行後記錄不會被刪除。任何想法是什麼原因?不支持aop事務配置的jdbc彈簧

Creating new transaction with name [com.accept.web.modules.personalization.UserPreferencesServiceImpl.delete]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 
Acquired Connection [ProxyConnection[PooledConnection[[email protected]]]] for JDBC transaction 
Bound value [[email protected]] for key [[email protected]{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.OracleDriver; maxActive=30; maxIdle=3; minIdle=0; initialSize=0; maxWait=30000; testOnBorrow=false; testOnReturn=false; timeBetweenEvictionRunsMillis=600000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=1800000; testWhileIdle=true; testOnConnect=false; password=accept; url=jdbc:oracle:thin:@bbhangale-pc:1521/bbhangale; username=accept; validationQuery=select name from usr_user where id=104; validationInterval=1200000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=360; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; }] to thread [http-8001-1] 
Initializing transaction synchronization 
Getting transaction for [com.accept.web.modules.personalization.UserPreferencesServiceImpl.delete] 
Executing prepared SQL update 
Executing prepared SQL statement [SELECT "KEY", "VALUE" FROM config WHERE "KEY" IN (?) AND user_id = ?] 
Retrieved value [[email protected]] for key [[email protected]{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.OracleDriver; maxActive=30; maxIdle=3; minIdle=0; initialSize=0; maxWait=30000; testOnBorrow=false; testOnReturn=false; timeBetweenEvictionRunsMillis=600000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=1800000; testWhileIdle=true; testOnConnect=false; password=accept; url=jdbc:oracle:thin:@bbhangale-pc:1521/bbhangale; username=accept; validationQuery=select name from usr_user where id=104; validationInterval=1200000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=360; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; }] bound to thread [http-8001-1] 
Setting SQL statement parameter value: column index 1, parameter value [FILTER_rcaGrid], value class [java.lang.String], SQL type unknown 
Setting SQL statement parameter value: column index 2, parameter value [107], value class [java.lang.Integer], SQL type unknown 
Retrieved value [[email protected]] for key [[email protected]{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.OracleDriver; maxActive=30; maxIdle=3; minIdle=0; initialSize=0; maxWait=30000; testOnBorrow=false; testOnReturn=false; timeBetweenEvictionRunsMillis=600000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=1800000; testWhileIdle=true; testOnConnect=false; password=accept; url=jdbc:oracle:thin:@bbhangale-pc:1521/bbhangale; username=accept; validationQuery=select name from usr_user where id=104; validationInterval=1200000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=360; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; }] bound to thread [http-8001-1] 
SQL update affected 1 rows 
Retrieved value [[email protected]] for key [[email protected]{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.OracleDriver; maxActive=30; maxIdle=3; minIdle=0; initialSize=0; maxWait=30000; testOnBorrow=false; testOnReturn=false; timeBetweenEvictionRunsMillis=600000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=1800000; testWhileIdle=true; testOnConnect=false; password=accept; url=jdbc:oracle:thin:@bbhangale-pc:1521/bbhangale; username=accept; validationQuery=select name from usr_user where id=104; validationInterval=1200000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=360; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; }] bound to thread [http-8001-1] 
Completing transaction for [com.accept.web.modules.personalization.UserPreferencesServiceImpl.delete] 
Triggering beforeCommit synchronization 
Triggering beforeCompletion synchronization 
Initiating transaction commit 
Committing JDBC transaction on Connection [ProxyConnection[PooledConnection[[email protected]]]] 
Triggering afterCommit synchronization 
Triggering afterCompletion synchronization 
Clearing transaction synchronization 
Removed value [[email protected]] for key [[email protected]{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.OracleDriver; maxActive=30; maxIdle=3; minIdle=0; initialSize=0; maxWait=30000; testOnBorrow=false; testOnReturn=false; timeBetweenEvictionRunsMillis=600000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=1800000; testWhileIdle=true; testOnConnect=false; password=accept; url=jdbc:oracle:thin:@bbhangale-pc:1521/bbhangale; username=accept; validationQuery=select name from usr_user where id=104; validationInterval=1200000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=360; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; }] from thread [http-8001-1] 
Releasing JDBC Connection [ProxyConnection[PooledConnection[[email protected]]]] after transaction 
Returning JDBC Connection to DataSource 
+2

我在日誌中看不到刪除語句。請在刪除記錄的位置顯示代碼。 – tobiasbayer

+0

@tob是對的!請發佈正在處理刪除內容的代碼......並按照danny.lesnik的說法,接受您之前(6)個問題的答案。 – Rakesh

回答

0

現在所有工作都很好。我忘記將查詢更改爲刪除查詢。正如您所指出的,您在日誌中看不到任何刪除查詢。