Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


0
(click on this box to dismiss)

단순 select하는 쿼리에서 낮은 빈도로 UncategorizedSQLException이 발생하는데 원인을 모르겠습니다.

- 단순 select 쿼리이며, 호출수는 많은 편입니다.

 

* 1달에 22건 정도로 exception빈도는 상당히 낮은데요.. 원인을 모르겠어서.. 문의드립니다. 어느 경우에 아래와 같은 exception이 발생하는지 그리고 해결책이 있는지 확인 부탁드립니다. (__)

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in sqlmap/dummy.xml. --- The error occurred while applying a result map. --- Check the com.nhncorp.coupon.common.biz.neoid.select-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: java.sql.SQLException: org.apache.commons.dbcp.PoolablePreparedStatement with address: "cubrid.jdbc.driver.CUBRIDPreparedStatement@8dae665" is closed.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in sqlmap/dummy.xml. --- The error occurred while applying a result map. --- Check the com.nhncorp.coupon.common.biz.neoid.select-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: java.sql.SQLException: org.apache.commons.dbcp.PoolablePreparedStatement with address: "cubrid.jdbc.driver.CUBRIDPreparedStatement@8dae665" is closed. at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)

 

 

 

 

 

link comment (0)
asked 8 months ago
miniwikibook
1
78 Answers
0

The error pattern is as follows. The error occurs regardless of database types you are using. 

Cause: cubrid.jdbc.driver.CUBRIDException: Attempt to access a closed PreparedStatement.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred while applying a parameter map.

--- Check the InstalledApp.findInstalledAppListCount-InlineParameterMap.

--- Check the parameter mapping for the 'serviceTypeCode' property.

--- Cause: cubrid.jdbc.driver.CUBRIDException: Attempt to access a closed PreparedStatement.)'}

 

The error occurs your code which returns resources is in wrong order in SqlMapClientTempate, Spring.

 

1) When your application includes the code(BO) which uses SqlMapClientTemplate however NOT uses TransactionManager in Spring. If your application uses TransactionManager to manage transactions, it arranges connection returning order so no problem occurs.

 

2) However if your application uses SqlMapClientTemplate only, Spring intercepts Datasource and make transactions before/after BO and changes order of obtaining/returning connections. 

 

3) Additional condition is your application uses preparedStatement cache in DBCP and preparedStatement cache in iBatis at the same time. 

 

 

To summarize conditions:

    1. Using SqlMapClientTemplate in Spring

    2. Using TransactionManager in Spring

    3. Using statement cache in IBatis(default:true)

    4. Using statement cache in DBCP

 

To resolve the problem:

Change an option statementCachingEnabled to false in iBatis and use only DBCP cache. Otherwise, change your code in SqlMapClientTemplate. 

 

Anyway, it doesn't look CUBRID issues.

link comment (0)
answered 8 months ago
cottonspan
61
tagged




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: