Я пытаюсь использовать хранимую процедуру, и веб-приложение останавливается, когда я вызываю процедуру несколько раз. Остановлено при открытии соединения JDBC. такое mybatis-spring есть проблема при вставке оператора?
Я вызвал хранимую процедуру, которая обновляет таблицу, и, если она не может найти целевую строку, просто вставьте новую строку. Но, когда я вызываю процедуру несколько раз, веб-приложение останавливается и все соединение с БД не устанавливается. Я пытаюсь изменить компонент db-context. Но это все еще не работает.
my db-context.xml настроен следующим образом.
->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" >
<property name="dataSource" ref="repositoryDataSource" />
<property name="configLocation" value="/WEB-INF/config/mybatis/mybatis-config.xml" />
<property name="mapperLocations" value="/WEB-INF/config/mybatis/mapper/*.xml" />
<property name="databaseIdProvider" ref="databaseIdProvider" />
</bean>
<bean id="vendorProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="SQL Server">sqlserver</prop>
<prop key="DB2">db2</prop>
<prop key="Oracle">oracle</prop>
<prop key="MySQL">mysql</prop>
</props>
</property>
</bean>
<bean id="databaseIdProvider" class="org.apache.ibatis.mapping.VendorDatabaseIdProvider">
<property name="properties" ref="vendorProperties" />
</bean>
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="clearCache">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
Журналы внизу - это работающие журналы.
DEBUG [org.mybatis.spring.SqlSessionUtils] Creating a new SqlSession
DEBUG [org.mybatis.spring.SqlSessionUtils] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6d896e0a] was not registered for synchronization because synchronization is not active
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Opening JDBC Connection
DEBUG [org.mybatis.spring.SqlSessionUtils] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6d896e0a]
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Closing JDBC Connection [jdbc:sqlserver://serverIP:PORT;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=testDataBaseName;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=user, Microsoft JDBC Driver 4.0 for SQL Server]
DEBUG [org.mybatis.spring.SqlSessionUtils] Creating a new SqlSession
DEBUG [org.mybatis.spring.SqlSessionUtils] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3d4bdd0f] was not registered for synchronization because synchronization is not active
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Opening JDBC Connection
DEBUG [Report.CALL_UP_SP] ==> Preparing: {call CALL_UP_SP ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )}
DEBUG [Report.CALL_UP_SP] ==> Parameters: 0(Integer), 19277(String), saveName(String), 2261(String), PUBLIC(String), 370(String), someString(String), (String), (String), (String), (String), (String), (String), (String), someString(String), someString(String), someString(String), someString(String), PFBBUkFNX1hNTC8+(String), (String), 1000(String), N(String), N(String), (String), 1000(String), N(String)
DEBUG [Report.CALL_UP_SP] <== Total: 1
DEBUG [org.mybatis.spring.SqlSessionUtils] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3d4bdd0f]
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Closing JDBC Connection [jdbc:sqlserver://serverIP:PORT;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=testDataBaseName;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=user, Microsoft JDBC Driver 4.0 for SQL Server]
И я прикрепляю сломанный журнал.
DEBUG [org.mybatis.spring.SqlSessionUtils] Creating a new SqlSession
DEBUG [org.mybatis.spring.SqlSessionUtils] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@25f74881] was not registered for synchronization because synchronization is not active
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Opening JDBC Connection
DEBUG [org.mybatis.spring.SqlSessionUtils] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@25f74881]
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Closing JDBC Connection [jdbc:sqlserver://serverIP:PORT;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=testDataBaseName;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=user, Microsoft JDBC Driver 4.0 for SQL Server]
DEBUG [org.mybatis.spring.SqlSessionUtils] Creating a new SqlSession
DEBUG [org.mybatis.spring.SqlSessionUtils] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@18d75584] was not registered for synchronization because synchronization is not active
DEBUG [org.apache.ibatis.transaction.managed.ManagedTransaction] Opening JDBC Connection (--> web-application doesn't work after it)
Как видите, org.apache.ibatis.transaction.managed.ManagedTransaction открывает JDBC-соединение, но после этого оно не работает.
Итак, я попытался перезапустить Tomcat 7, следующий журнал представлен на консоли Eclipse.
The web application [/test] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@14d49cb3]) and a value of type [org.apache.ibatis.executor.ErrorContext] (value [
### The error may exist in ServletContext resource [/WEB-INF/config/mybatis/mapper/test.xml]
### The error may involve test.CALL_UP_SP
### The error occurred while executing a query]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Кто-нибудь знает эту проблему?