This is one of the problem using connection pooling.
This page explains it and offers a solution:

http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html

I hope it helps.




Balazs Michnay wrote:
Dear Struts users,

Finally I managed to get DB-handling working, but I'm experiencing problems.
When I query the database for about the 10th time, I get the following error 
message:

"java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
... ..."

In previous posts I read that I can somehow check the memory usage and see if I 
ran out of memory.
Where can I check this? Any suggestions on fixing this? I hope there is a way 
to fix this, because
I found very few resources online on how to set up database handling in Struts.

----------------------------
Here's how I set it up (if it helps...)

1) I added mysql driver's jar file to my projec's lib directory and I copied taglibs-dbtags.tld to WEB-INF

2) These lines were added to web.xml:

    <resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/SZTGKR</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

    <taglib>
        <taglib-uri>/WEB-INF/dbtags.tld</taglib-uri>
        <taglib-location>/WEB-INF/taglibs-dbtags.tld</taglib-location>
    </taglib>


3) And I used the connection in a jsp:

<%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags"; prefix="sql" %>

    <sql:connection id="conn1">
            <sql:userId>userakarmi</sql:userId>
            <sql:password>kod</sql:password>
            <sql:url>jdbc:mysql://localhost:3306/proba</sql:url>
            <sql:driver>com.mysql.jdbc.Driver</sql:driver>
    </sql:connection>

    <sql:statement ...
--------------------------------------

If there is no way to fix this, any guides to any working configurations?
I'm really looking forward to getting some replies, because I'm stuck here.
Thanks a lot for your help!!

Regards,

Michnay



____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091


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

Reply via email to