Results 1 to 7 of 7

Thread: Does Web Flow Persistence Context work with a Tomcat Managed DBCP?

  1. #1

    Default Does Web Flow Persistence Context work with a Tomcat Managed DBCP?

    Will a web flow that uses
    Code:
    <persistence-context/>
    work if the database connection pool is manged by tomcat (in GlobalNamingResources of server.xml) and retrieved by spring using JNDI, or is it required that the dataSource be a spring managed bean of type
    Code:
    org.apache.commons.dbcp.BasicDataSource
    ?

    I am currently using a Tomcat managed pool and after completion of every flow (after the commit), there is always one db connection that becomes unusable and eventually I run out of connections. I am trying to determine if I am not managing Transactions correctly or if Spring Web Flow might not work with a persistence-context unless it uses a spring managed dbcp.

    Anyone know if this SHOULD work with Tomcat managed pool?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    It can be any DataSource, local or jndi it matters not...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jun 2012
    Posts
    2

    Default

    I have the same problem.
    Please can somebody explain where in the documentation this problem is described ?

    Thanks

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    As mentioned it doesn't matter where the datasource comes from, it works with ANY datasource...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Jun 2012
    Posts
    2

    Default

    and your solution is ?

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    There is no solution as it isn't a problem... It works with any datasource a datasource is a datasource regardless if it comes from xml, java or jndi... How to do a jndi lookup is extensively described in the Spring Framework reference guide, which I suggest you read.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    May 2012
    Posts
    13

    Default

    if you are using hibernate 4 then you are running out of connections, because it is a spring webflow related bug. maybe thats the cause of your problem. normally all connections are correctly returned to the pool.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •