Results 1 to 4 of 4

Thread: Connection is not getting closed Ibatis+Spring+JNDI(JBoss)

  1. #1
    Join Date
    Jul 2007
    Posts
    7

    Question Connection is not getting closed Ibatis+Spring+JNDI(JBoss)

    Connection is not getting closed for MSSQL Server 2005 (Developer) for sa (admin) user. since admin user has only one dedicated connection database is throwing exception. I tried with other users too but getting the same exception.

    Is there any way to close the connection in Ibatis or spring config file which was created by Spring bean

    my Spring configuration
    <jee:jndi-lookup id="dataAccess.dataSource" jndi-name="jdbc/myJNDI"/>

    I am referring the above bean in IBATIS configuration to get the connection object

    This setup is working fine for inserting the single records but when i try to insert the multiple (20+) records then it fails with exception : http://forum.springframework.org/showthread.php?t=41634

    After looking into the database log it come to know that connection is not getting closed.

    Is there any way to close the connection explicitly either in configuration file or in IBATIS generated code.

    Thanks,
    Santosh Maskar

  2. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Have you got a connection leak somewhere, or are you not releasing the connections back to the pool?
    Last edited by karldmoore; Aug 27th, 2007 at 04:19 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  3. #3
    Join Date
    Jul 2007
    Posts
    7

    Default

    I am not creating a connection, Ibatis is creating a connection for me. I dont have control to close the connection because Ibatis is closing the connection.

    but in my case I feel connection is not getting closed somewhere.


    Ibatis is creating a new connection using the spring bean, somehow IBATIS is not closing the connection thats is the reason I am getting exception.

    how do i close the connection explicitly.

    Thanks,
    Santosh Maskar

  4. #4
    Join Date
    Jul 2007
    Posts
    7

    Default

    problem was resolved, It is because of not connection leak but it was related to admin user from sql server 2005.

    Admin user has only one dedicated connection and cant be used with pool. Created a new user and everything works fine

Posting Permissions

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