• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is a stateful database connection and how to create it

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to know what is stateful connection and how can I create it ?
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic