• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

seat sold twice

 
Jacek Ostrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

I wonder how to guarantee that seat is not sold more than once if seat is persisted via entity bean.
There is no problem for SLSB+DAO - multi-column unique index on "reservation" table would do a trick.

But how to handle this with entity beans ?

Jacek
 
Ådne Brunborg
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is handled via the isolation level you set for the entity bean in question. The exact details depend on the container you use, but it should suffice to say that it can be handled.
 
Jacek Ostrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree that it can be handled.
My concerns were that part of our job is to make sure that it will be possible to handle it in efficient way.

It is simple when seats are not shared between flights (Flight 1---1 Equipment) but it may be very hard to do if we change BDM to (Flight *---1 Equipment)

Jacek
 
Ådne Brunborg
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My personal opinion in that matter is that it is very difficult to handle anything in an efficient manner using entity beans.

However, using a less bleak, disillusioned view - it is difficult to say anything absolute without knowing your class diagrams. I haven't studied the domain model in detail yet, haven't made my database model yet. But it shouldn't be that hard - one piece of equipment can only be doing one flight at a time, and a seat on a flight is either booked or not booked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic