Hi there,
I use pure Servlet/JSP based code, not including any EJB based code, under
JBoss app server. Use non-managed environment configuration same as other pure
servlet container, such as Resin, but accessing database became unstable. It
will sometimes throw exception:
- ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query:
SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound
However, everything is ok under other servlet container, like Resin.
The non-managed environment configuration is following:
1. In OJB.properties:
-
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
-
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
-
JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory
2. In repository_database.xml:
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="Oracle9i"
jdbc-level="2.0"
driver="oracle.jdbc.driver.OracleDriver"
protocol="jdbc"
subprotocol="oracle"
dbalias="thin:@localhost:1521:orains1"
username="scott"
password="tiger"
eager-release="false"
batch-mode="true"
useAutoCommit="0"
ignoreAutoCommitExceptions="false">
<object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
<attribute attribute-name="timeout" attribute-value="900"/>
<attribute attribute-name="autoSync" attribute-value="true"/>
</object-cache>
<connection-pool maxActive="21" validationQuery=""/>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
<attribute attribute-name="grabSize" attribute-value="20"/>
<attribute attribute-name="autoNaming" attribute-value="true"/>
<attribute attribute-name="globalSequenceId" attribute-value="false"/>
<attribute attribute-name="globalSequenceStart"
attribute-value="10000"/>
</sequence-manager>
</jdbc-connection-descriptor>
When I change to managed environment configuration, and run again. It throws
another different exception:
- ERROR [TranslationUtil] Cannot pre-load translation cache
java.lang.UnsupportedOperationException: In managed environments only JTA
transaction demarcation allowed
This kind of error *always* occurs, not as *sometimes*, mentioned above.
The managed environment configuration is following:
1. In OJB.properties:
-
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl
-
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
-
JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory
2. In repository_database.xml:
(Same as above non-managed environment configuration)
Not changing any code is preferred, I want to just modify some configuration to
go. Can anyone tell me how to deal with? Any comments would be very welcome.
Thanks,
Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]