Want to fix some confusion. I have applicationContext.xml.
Question 1: What is the difference between 1 and 2. Are they both the same with the other approach?
Question 2:
I asked a question on the Spring forum regarding some problem. The fact that he mentioned the pool below
if you need / want to use the internal connection pool for sleep mode, I would advise against this and just configure a data source that supports pooling and injects it into your sessionfactorybean.
union of internal joins for hibernate = this is the number 2 below . Right?
just set up a data source that supports pooling and inserts it into your sessionfactorybean = This is the number 1 below . is not it?
one # -
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="maxActive" value="100"/> <property name="maxIdle" value="30"/> <property name="maxWait" value="16000"/> <property name="minIdle" value="0"/> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="annotatedClasses"> <list> <value>com.mkyong.customer.model.Customer</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">false</prop> <prop key="hibernate.generate_statistics">true</prop> </props> </property> </bean>
2 # -
Information about the pool and connection is in the hibernate.cfg.xml file
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml" /> </bean>
spring java-ee hibernate struts2
Pirzada Sep 28 '12 at 6:07 2012-09-28 06:07
source share