Hi,

thanks all for the answers.
I wanted to use c3p0 instead of Proxool. Got mixed up. Sorry.

class="org.apache.commons.dbcp.BasicDataSource"

Apache DBCP Pooling is used here. This is probably a dump question. But why aren't there any configurations made? Is DBCP better than c3p0 (in this case)?



Don't. Using Spring, you should define the (possibly pooled) datasource as its own bean, and refer to it in the sessionFactory bean definition. Spring will instantiate and wire them up in the correct order.

Could you give me a small "code" hint, how this should look like. I'm totally new to spring.


Thanks
Jonny




From: Ugo Cei <[EMAIL PROTECTED]>
Reply-To: users@cocoon.apache.org
To: users@cocoon.apache.org
Subject: Re: Questions on CHS (Cocoon, Hibernate, Spring) petstore project
Date: Mon, 11 Apr 2005 13:56:09 +0200

Il giorno 11/apr/05, alle 10:40, Jonny Pony ha scritto:

I want to replace the HSQL with my MySQL database. What must I exactly change in the "applicationContext.xml" to do that.
Is this part still neccessary for my needs or does this only start and stop the hsql-database?


<bean id="hsqlServer" class="org.apache.cocoon.petstore.database.HsqlServer" init-method="start" destroy-method="stop"></bean>

You can remove this, as it is needed only to start the embedded HSQL server.


Nr.2:
I want to use the proxool connection-pooling. So is this part (in the "applicationContext.xml") still neccessary for my needs?:


<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" depends-on="hsqlServer">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
...
<property name="password">
<value/>
</property>
</bean>

If Proxool implements java.sql.DataSource, you can simply change the name of the implementing class. Also, remove depends-on="hsqlServer".



Or can I totally exchange it with something like this?:

<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
....
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
...
<prop key="hibernate.c3po.min_size">5</prop>
...
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
</props>
</property>
<property name="dataSource">
<ref bean="myDataSource"/>
</property>
</bean>

Don't. Using Spring, you should define the (possibly pooled) datasource as its own bean, and refer to it in the sessionFactory bean definition. Spring will instantiate and wire them up in the correct order.


And do I need something like the "myDataSource"-bean for my approach then?

Yes.

I couldn't find the mapping-files, like Account.hbm.xml,etc? Are there any? Or better: Is there a database-model for the petstore in generell?
In UML, mapping-files or whatever?

The mapping files are automatically generated by the build.xml script, using XDoclet. Look for @hibernate tags in comments. Try running "ant genmappings".



Is there some generell documentation for this chs-project?

Nothing besides what you can read on the website.

        Ugo

--
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/
<< smime.p7s >>

_________________________________________________________________
MSN Hotmail. Anmelden und gewinnen! http://www.msn.de/email/webbased/ Ihre Chance, eines von 10 T-Mobile MDA II zu gewinnen!



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to