Hi Guys,
I need some example code or guidance here.
Below is the description of my problem.
-------------------------------------
I have a web service with couples of web methods, example is like
1) getNames
2) getLectures
3) getClasses, etc..
So in each of this method, there is a statement which connects to database, meaning whenever user calls "getNames", it connects to db, then retrives the data, release the connection. Then if user calls "getLecturers" again, it connects to db, then retrieves the data again, and releases the connection again.
Im trying to eliminate the need of connecting to db for several times each time a web method is called
I plan to have two additional webmethods.
1) connect
2) disconnect
Meaning each time any developer wants to access this web service methods, they have to call the "connect" method, and then it will create a session of connection, and they can use a list of web methods, once they have finished, they call the "disconnect" web method.
Im not sure how to implement this, i want to only connect once and make the connection last for several minutes until its idle for certain time..
Really appreciate if someone can point out an example or reference on how can i implement this logic..
thank you very much..
I need some example code or guidance here.
Below is the description of my problem.
-------------------------------------
I have a web service with couples of web methods, example is like
1) getNames
2) getLectures
3) getClasses, etc..
So in each of this method, there is a statement which connects to database, meaning whenever user calls "getNames", it connects to db, then retrives the data, release the connection. Then if user calls "getLecturers" again, it connects to db, then retrieves the data again, and releases the connection again.
Im trying to eliminate the need of connecting to db for several times each time a web method is called
I plan to have two additional webmethods.
1) connect
2) disconnect
Meaning each time any developer wants to access this web service methods, they have to call the "connect" method, and then it will create a session of connection, and they can use a list of web methods, once they have finished, they call the "disconnect" web method.
Im not sure how to implement this, i want to only connect once and make the connection last for several minutes until its idle for certain time..
Really appreciate if someone can point out an example or reference on how can i implement this logic..
thank you very much..