Note that there are some explanatory texts on larger screens.

plurals
  1. POStandardXAConnectionHandle:prepareStatement should not be used outside an EJBServer
    primarykey
    data
    text
    <p>I have a web application deployed in a Tomcat 5.5 container. I use a <code>SessionEventListener</code> bean that logs some activities in the database. Sometimes I get this error message:</p> <pre><code>java.sql.SQLException: StandardXAConnectionHandle:prepareStatement should not be used outside an EJBServer at org.enhydra.jdbc.standard.StandardXAConnectionHandle.prepareStatement(StandardXAConnectionHandle.java:310) at org.enhydra.jdbc.standard.StandardXAConnectionHandle.prepareStatement(StandardXAConnectionHandle.java:255) at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:233) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:532) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:739) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:762) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:213) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:217) at hu.rate.session.RateDBSessionRegistry$4.doInTransactionWithoutResult(RateDBSessionRegistry.java:124) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at hu.rate.session.RateDBSessionRegistry.refreshLastRequest(RateDBSessionRegistry.java:120) </code></pre> <p>The code that fails is the following:</p> <pre><code>txTemplate.execute(new TransactionCallbackWithoutResult() { @Override public void doInTransactionWithoutResult( TransactionStatus paramTransactionStatus) { if(template.update(us, paramMap) == 0) { logger.warn("No session in registry to be refreshed, sessionId = " + sessionId); } } }); public void setTxManager(PlatformTransactionManager txManager) { txTemplate = new TransactionTemplate(txManager); } </code></pre> <p>My Spring bean config looks like this:</p> <pre><code>&lt;bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean" /&gt; &lt;bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"&gt; &lt;property name="userTransaction"&gt; &lt;ref local="jotm" /&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>I do not really understand this issue, can you explain me what is wrong and how to fix it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload