• 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

Is session Id must for CRUD

 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
without session Id can we do any operations like add,update,edit,delete. I saw Session id is loaded for edit and delete action
not for "Add" operation . so am asking this
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not following what you are asking here. Can you give us some context? CRUD operations using what technology?
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CRUD operations using struts and hibernate.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hibernate does not require an HTTP session to perform CRUD. Struts does not require an HTTP Session to use Hibernate. Whatever is happening is a design descision of you applciaiton itself not either of these products.
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friend, please go through this code .Here why session id used only for edit , not for add ,update actions. How can i send full code , it does not support .txt , .doc formats


 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, so you don't mean an HTTP session id, you mean the id of the object you plan to edit, load or delete. Yes you need this, this is just how databases work. You can't load an entity (which is the first step to editing or deleting it) without its ID. When you add a new entity there is no identifier (assuming you are using surrogate keys) so the id is not needed.

(NB: the roseindia Hibernate tutorials are not very good, I would not try to learn from them)
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well whether or not you need a session variable depends entirely on the Business that the CURD operation you performs supports.

If you are asking for Rule of thumb then we could say that in general most update/delete operation would require some identifier data to be present in the session (note this is not the session ID - its probably userID or something which is the primary key of the database).

Inserting of a new record (say add a new customer) would usually not require identifier data to be present in the session.

This is a very beginners view - for simple application. Data interaction in real applications could be a lot more complex!!
 
Saifuddin Merchant
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Sturrock wrote:
(NB: the roseindia Hibernate tutorials are not very good, I would not try to learn from them)



Yep I agree!!! Not a place for beginners to be ...
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic