I have a transaction manager bean in my xml
as follows :
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
and session factory and data source beans as :
<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="URL" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<property name="user" value="user"/>
<property name="password" value="password"/>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
with session factory having all the hbm
files mapping .
Now I have a UserAddressManagerImpl
as follows :
public class UserAddressManagerImpl implements UserAddressManager{
// methods to read and write in the database
}
and the bean for this is :
<bean id="userAddressManager" class="com.sodiz.service.impl.UserAddressManagerImpl">
Now , this UserAddressManagerImpl
doesn't have @Transactional
on it .
Whenever I make any read operation from this class it works well but when making write operation it fails.
I am using this class packaged in a jar. So I prefer not to change this class.
So, is there any way to perform the read and write operations without using @Transactional
annotations?