Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

Database Connection and Session State

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Grigs - 15 Aug 2005 18:48 GMT
Hello,

I have a web service that reads its web.config file to connect to an Oracle
database.  There are a number of methods in this socalled BACKBONE that
either send inforomation to or from the database.  That works great.

I have the INTERFACE which is what the user sees.  When the page is first
navigated to, it creates an object of the BACKBONE and calls certain Web
Methods to get data so I may populate dropdown lists and such.

That works great too.  :-)

However, my DBA wanted me to set an action for each "program" that connects
to his database.  I can create this "action" no problem.  The only issue is
that it happens to create 11 entries/connection to the database.  Bascially 1
for each of the 11 seperate calls I make to the BACKBONE.

I thought I could just create the connection in the BACKBONE's Global.asax
file as a session variable and use it when I need to connect to the DB but
that had no difference.  Still 11 connections.  I understand that the web
service simple is being called 11 seperate times.

My question is, is there any way to keep that web-service open?  Or some way
of at least storing the connection in a session variable that will stay?  I
have to believe I am not the only person creating a Web Service to do all of
the DB grunt work.  Are we all wasting connections and the overhead of
connections connecting?  Am I missing something here?

Please help,
Thanks in advance
Signature

Thanx,
Grigs

Bill Priess (MCP) - 15 Aug 2005 23:35 GMT
Web Services, like web apps, are truly stateless, which means that even if
you have a "session", it's a disconnected session. The clients connect, call
a method (or methods) and then disconnects. You can use the enableSession
parameter of the WebMethod attribute, but I don't think that you are going
to get the results that you want. By default, ADO.NET should be pooling your
connections, but I am not certain if that is the case when it comes to
Oracle and their "less than perfect" .Net providers (I know for a fact that
the SQL Server provider does connection pooling). You might want to contact
MSFT and/or Oracle about the provider perfomance and see if there is a way
to enable connection pooling to the database.

HTH,
Bill Priess, MCP

> Hello,
>
[quoted text clipped - 33 lines]
> Please help,
> Thanks in advance
oraclevsmicrosoft - 30 Aug 2005 17:57 GMT
I didn't try it  for pooling a connection (Some .net connection object
are pooled  automatically) , but I store  session objects like this :

protected void Session_Start(Object sender, EventArgs e)
        {

    Session.Add("USER_INFO", new myUserinfoObject(User));
        }

In order to make this works for my web method   I put the  following:

....
[ WebMethod(Description="blabla",EnableSession=true) ]
        public DataSet getDs()
        {
...
    myUserinfoObject= (UserinfoObject)Session["USER_INFO"] ;
.....

You may try this   for  your  connection.

Hope this helps

http://oraclevsmicrosoft.blogspot.com

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.