cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Velychko <v_pe...@ukr.net>
Subject Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]
Date Tue, 11 May 2004 19:26:27 GMT
Hello Hugo,

Tuesday, May 11, 2004, 9:15:35 PM, you wrote:
> Hello Peter,

> Can you be a little bit more specific about your Tomcat configuration?
Of course

> - Java version?
1.4.2-b28 on WinXP


> - Tomcat version?
4.1.18

> - What is in the Tomcat endorsed lib?
    xalan-2.6.0.jar
    xercesImpl-2.6.2.jar
    xml-apis.jar
Also I've placed c3p0-0.8.4.5.jar in {$tomcat.dir}/common/lib
    
> - How did you handle the jars that are both in Hibernate and in Cocoon but
> have different versions (commons-..., etc.)?
I have the following libs in classpath:
    commons-collections-3.0.jar
    commons-lang-2.0.jar
I've commented
    
> - Do you use a recent version of cocoon 2.1.5-cvs?
Yes, I have cvs version of today's morning.

> - Is it a Hibernate *release* version 2.1.3?
Yes, I use hibernate 2.1.3.
RDBMS - Oracle 9.2

> Sorry for asking so many questions, but I guess most of them are easy to
> answer.
I've set up c3p0 pool only on my computer and it works well (see my
configuration details below). Please note that I use dbcp on
production and cannot test c3p0 pooling on Linux

"server.xml"
<Resource name="jdbc/MyDB" scope="Shareable" auth="Container"
                 type="com.mchange.v2.c3p0.ComboPooledDataSource"/>
<ResourceParams name="jdbc/PHotels2DB">
        <parameter>
                <name>factory</name>
                <value>org.apache.naming.factory.BeanFactory</value>
        </parameter>
        <parameter>
                <name>user</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>password</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>driverClass</name>
                <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
        <parameter>
                <name>jdbcUrl</name>                                         
          
                <value>jdbc:oracle:thin:@serverurl:1521:db</value>
        </parameter>
        <parameter>
                <name>minPoolSize</name>
                <value>5</value>
        </parameter>
        <parameter>
                <name>maxPoolSize</name>
                <value>15</value>
        </parameter>
        <parameter>
                <name>acquireIncrement</name>
                <value>5</value>
        </parameter>
</ResourceParams>

"hibernate.cfg.xml"
<hibernate-configuration>
    <session-factory>
        <property name="connection.datasource">java:comp/env/jdbc/MyDB</property>
        <property name="show_sql">false</property>
        <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
        <property name="jdbc.use_streams_for_binary">true</property>
        <property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
        <property name="cache.use_query_cache">true</property>
        <property name="jdbc.batch_size">0</property>
        <property name="cache.region_prefix">my</property>
        <property name="jdbc.use_scrollable_resultset">true</property>
        <property name="c3p0.minPoolSize">5</property>
        <property name="c3p0.maxPoolSize">20</property>
        <property name="c3p0.timeout">1800</property>
        <property name="c3p0.max_statement">50</property>
        <mapping resource="mapping.hbm"/>
    </session-factory>
</hibernate-configuration>

"web.xml"
<resource-ref>
    <description>Datasource</description>
    <res-ref-name>jdbc/MyDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

> Thanks,

> Hugo Burm

>> -----Original Message-----
>> From: Peter Velychko [mailto:v_peter@ukr.net]
>> Sent: Tuesday, May 11, 2004 10:39 AM
>> To: Leszek Gawron
>> Subject: Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost
>> from dev]
>>
>>
>> Hello Leszek,
>>
>> I have in production the following configuration:
>>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
>> It works without problem.
>>
>> Just now I've configured my tomcat to work with c3p0 connection pool
>> and it works corectly also.
>>
>> I'll try to start my application on jetty. What version of jetty are
>> you use?
>>
>> Sunday, May 9, 2004, 11:57:27 AM, you wrote:
>>
>> > This is a repost from cocoon-dev list. Maybe someone of
>> cocoon users might
>> > help me?
>>
>> > I think there is a serious problem with latest version  of
>> > hibernate (2.1.3) and cocoon integration. There is some
>> kind of jar problem
>> > that did not occur with 2.1.2. I have attached a exception
>> log. The problem
>> > occurs only with hibernate running in cocoon when you want
>> to use c3p0
>> > connection pooling. When you hit the server the exception
>> gets thrown that you
>> > cannot obtain the connection because it has already been closed.
>>
>> > My tests showed that:
>> > 1. The problem does not occur with hibernate built-in
>> pooling (but this one is
>> > unuseable in production environment - at least hibernate
>> web page states that)
>>
>> > 2. The problem is not a problem of hibernate itself. I have
>> been able to run
>> > hibernate with c3p0 outside of cocoon and jetty (although
>> all jetty and cocoon
>> > libs were also on the classpath - really strange - maybe
>> jar order on
>> > classpath matters).
>>
>> > 3. The problem is not a problem of c3p0 itself. Hibernate
>> 2.1.3 contains a new
>> > version of c3p0 (0.8.4.5) but if you downgrade only
>> hibernate2.jar to 2.1.2
>> > version the problem disapperas.
>>
>> > 4. The problem is not database dependent. I have tries both
>> MS SQL Server and
>> > HSQLDB - both do not work with cocoon+hibernate+c3p0.
>>
>> > I use following libraries that are copies to cocoon lib directory:
>> > c3p0-0.8.4.5.jar
>> > cglib-full-2.0.1.jar
>> > commons-dbcp-1.1.jar
>> > commons-pool-1.1.jar
>> > dom4j-1.4.jar
>> > hibernate2.jar
>> > jdbc2_0-stdext.jar
>> > jta.jar
>> > msbase.jar
>> > mssqlserver.jar
>> > msutil.jar
>> > odmg-3.0.jar
>>
>> > The rest needed libraries are already in cocoonlib dir
>> (although versions
>> > differ). Hibernate is using commons collections 2.1 while
>> cocoon uses 3.0 but
>> > this caused no problems with hib2.1.2
>>
>> > My regards
>> >         LG
>>
>>
>> --
>> Best regards,
>> Peter Velychko
>> v_peter@ukr.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message