This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is a stateful database connection and how to create it

 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know what is stateful connection and how can I create it ?
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
miro con wrote:I want to know what is stateful connection and how can I create it ?
http://tinyurl.com/mz3x7x
 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps wrote:
miro con wrote:I want to know what is stateful connection and how can I create it ?
http://tinyurl.com/mz3x7x


I first tried that, did not get any help so I am posting in forums ,they say about a stateful connection but donot say what makes a jdbc connection stateful ,we have an very old project and guys there say they create a stateful database connection , when I aksed them what is the diference between stateful and stateless database connection they did not have any answers , and more over they are not good at programming so I cannot expect answers from them and would like to know what they mean , please help me understand if you know the difference ?
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a stateful connection, you rely on the fact that you will keep on using the same database connection (session) during the run of your application.
Such programs typically use database session variables or temporary tables.
They might set a variable in database action a: (example: user selects country "china", program stores this country in an environment variable).
They can use that variable later on in action b: (example: they have built some views that will restrict data based on that variable, without the need for your program to filter yourself: you can do "select city from world_cities_view" , but the database would only return Chinese cities ).

A stateless connection does not rely on any activity that has occurred in the past. It does not remember anything.
You should treat Connection Pool connections as stateless.

You can use dedicated connections as stateful. The database can remember things for you.


Some info: http://www.dulcian.com/papers/RMOUG/2008_RMOUG_Rosenblum_StateFULL.pdf
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic