Discussion:
[jboss-user] [Datasource Configuration] - Web -Services connection Handling
gireesh g
2013-01-04 05:34:22 UTC
Permalink
gireesh g [https://community.jboss.org/people/ggireeshg] created the discussion

"Web -Services connection Handling"

To view the discussion, visit: https://community.jboss.org/message/787501#787501

--------------------------------------------------------------
Hi All,
1. I have implemented a *web service* with connection pooling(*oracle-ds.xml*) with *JBoss (http://www.coderanch.com/forums/f-63/JBoss)* server. In My business class, i am getting connection from pool and performing 4 to 5 DB operations, at last closing connection, statements and result set. It is working fine for one request.
2.If i tried for concurrent requests (Consider 5) only 1 or 2 processed, remaining failed with several reasons like (connection closed, statement closed, unusable connection, result set closed etc).
3.If i keep business class method as "synchronized" it is working fine. But it is serving only one request at a time (for concurrent request also). - This is slow downs my response time.

I came to know, This is connections problem, if one thread is doing DB operation, other thread is closing the connection or statement or result set.

Can any one help and tell me how to handle concurrent requests with out synchronized keyword.

Thanks in Advance.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787501#787501]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Frank Langelage
2013-01-04 12:34:31 UTC
Permalink
Frank Langelage [https://community.jboss.org/people/lafr] created the discussion

"Re: Web -Services connection Handling"

To view the discussion, visit: https://community.jboss.org/message/787584#787584

--------------------------------------------------------------
We need more information.
Can you show us a class model?
Web-Service class and business class are different classes?
Business class is an EJB or a POJO?
Show us the code and the place where you put the "synchronized" keyword as a workaround.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787584#787584]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
gireesh g
2013-03-29 04:18:45 UTC
Permalink
gireesh g [https://community.jboss.org/people/ggireeshg] created the discussion

"Re: Web -Services connection Handling"

To view the discussion, visit: https://community.jboss.org/message/805421#805421

--------------------------------------------------------------
Hi Frank,
Thanks for your replay. Still my problem exists, but managing with synchronized it leads performance issues.
My webservice class looks like

TestService.java

{
private Business business;
public Business getbusiness() {
        return business;
    }

    public void setbusiness(Business business) {
        this.business= business;
    }

business.validateMember()   // business is the object wich i created using spring ioc, which is singleton false, below mentined the code snippet.

}

Business Class

Business.java
{

synchronized validateMember()
{
// java code.

}

}

application-context.xml
-------------------------------------
<bean id="business" class="org.core.Business" singleton="false">
<bean id="testService" class="org.core.TestService" singleton="false">
        <property name="business"><ref bean="business"/></property>
     </bean>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/805421#805421]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Loading...