java - Configure spring datasource for hibernate and @Transactional -
at moment i'm using drivermanagerdatasource @transactional annotation manage transactions. transactions very slow, because data source open , close connection db each time.
what data source should use speed transaction?
drivermanagerdatasource
isn't connection pool , should used testing. should try basicdatasource
apache commons dbcp. like:
<bean id="datasource" destroy-method="close" class="org.apache.commons.dbcp.basicdatasource"> <property name="driverclassname" value="${jdbc.driverclassname}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean>
Comments
Post a Comment