0

マルチスレッド/マルチアプリ環境でOracle Streams AQを使用するとAQOracleSQLException、1つのスレッドのみで約10分間操作した後、Exhausted Resultsetを受け取りました。

oracle.AQ.AQOracleSQLException: Exhausted Resultset
        at oracle.AQ.AQOracleSession.getQueue(AQOracleSession.java:751)
        at au.com.xxx.queue.OracleQueue$$anonfun$2.apply(OracleQueue.scala:53)

AQOracleSession、次のように Spring を介してプールされます。

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="jdbc/MessageManagerDB"/>
</bean>

<bean id="aqSessionFactory" class="au.com.xxx.queue.AQSessionFactory">
    <constructor-arg ref="dataSource"/>
</bean>

<bean id="aqSessionTarget" factory-bean="aqSessionFactory" 
    factory-method="createAQSession" scope="prototype"/>

<bean id="aqSessionPoolTargetSource" 
    class="org.springframework.aop.target.CommonsPoolTargetSource">
    <property name="targetBeanName" value="aqSessionTarget"/>
    <property name="maxSize" value="25"/>
</bean>

<bean id="aqSession" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="targetSource" ref="aqSessionPoolTargetSource"/>
</bean>

ファクトリ メソッドcreateAQSessionを (Scala で) 使用すると、次のようになります。

def createAQSession = {
  val wasConnection = dataSource.getConnection.asInstanceOf[WSJdbcConnection]
  val connection = WSCallHelper.getNativeConnection(wasConnection).asInstanceOf[Connection]
  SessionWithConnection(AQDriverManager.createAQSession(connection), connection)
  // SessionWithConnection is just a case class akin to 
  // Tuple2[AQOracleSession, Connection]
}

このブロックの最終行から例外がスローされました。

def sessionAndConnection = {
  applicationContext.getBean("aqSession").asInstanceOf[SessionWithConnectionI]
}

def write(category: String, relatedId: Option[String], payload: String): Array[Byte] = {
  val (session, conn) = {
    val sc = sessionAndConnection
    (sc.session, sc.connection)
  }
  val queueDef = dao.queueForWriting(category, relatedId).map{_.name}
  val queue = queueDef.map{name => session.getQueue("QUSR", name)}

明らかに、私はResultSetused withinを直接扱っていませんAQOracleSession

に関連付けられたを使用していますが、これは同じメソッドの後半までではないため、ここで問題が発生することはありません。ConnectionSession

val clob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION)

プーリング構成が正しくなく、同じセッションでいくつかの同時操作があった可能性はありますか? 他のログにはまったく異常はありませんでした。

4

1 に答える 1

0

これは、私が誤って使用していたv10ドライバーの欠陥です。v11RDBMSドライバーにはこの問題はありません。

于 2011-04-14T13:35:19.460 に答える