ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torx <aito...@hotmail.com>
Subject Re: Ibatis 2.3.0 + postgresql 8.2, returns org.postgresql.util.PSQLException: ERROR: transaction is read-only.
Date Mon, 11 Aug 2008 16:26:48 GMT

Hello Larry,

I use DataSourceTransactionManager + TransactionInterceptor in Spring
transaction config.

This is my config:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbcostgresql://localhost:.../...."/>
<property name="username" value="...."/>
<property name="password" value="...."/>
<property name="maxActive" value="10"/>
<property name="maxIdle" value="5"/>
<property name="minIdle" value="5"/>
<property name="maxWait" value="5000"/>
<property name="defaultReadOnly" value="false"/>

</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>

<bean id="transaccion" class="org.springframework.transaction.interceptor
.TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributeSource">
<ref bean="defaultTxAttributes"/>
</property>
</bean>

<bean id="defaultTxAttributes"
class="org.springframework.transaction.interceptor
.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="update*">
PROPAGATION_REQUIRED,
ISOLATION_DEFAULT,-FatalException,-ServiceException,readOnly
</prop>
<prop key="set*">
PROPAGATION_REQUIRED,
ISOLATION_DEFAULT,-FatalException,-ServiceException,readOnly
</prop>
<prop key="insert*">
PROPAGATION_REQUIRED,
ISOLATION_DEFAULT,-FatalException,-ServiceException,readOnly
</prop>
<prop key="delete*">
PROPAGATION_REQUIRED,
ISOLATION_DEFAULT,-FatalException,-ServiceException,readOnly
</prop>
<prop key="select*">
PROPAGATION_SUPPORTS, ISOLATION_DEFAULT, readOnly
</prop>
<prop key="get*">
PROPAGATION_SUPPORTS, ISOLATION_DEFAULT, readOnly
</prop>
</props>
</property>
</bean>

The select operation works fine, but update does not work because
transacction is read only.

Thanks,
Torx



Larry Meadors wrote:
> 
> I'm running pg 8.3.3 with spring 2.5.5 and ibatis 2.3.3 - no issues...
> 
> Can you provide more details on the code?
> 
> Larry
> 
> 
> On Mon, Aug 11, 2008 at 12:14 AM, Torx <aitordg@hotmail.com> wrote:
>> I'm working with Spring 2.0. + Ibatis 2.3.0 + postgresql 8.2, and the
>> update
>> operation returns org.postgresql.util.PSQLException: ERROR: transaction
>> is
>> read-only.
>>
>> Anybody know any issue between Ibatis and postgresql for this error?
>> I make the connection JDBC directly from java and it works, but from
>> spring+ibatis is does not work.
>>
>> Could anybody help me ???
> 
> 

-- 
View this message in context: http://www.nabble.com/Ibatis-2.3.0-%2B-postgresql-8.2%2C-returns-org.postgresql.util.PSQLException%3A-ERROR%3A-transaction-is-read-only.-tp18920683p18929169.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message