Well i m not sure how to exactly phrase this but here i go.
So i have a matrix of checkboxes.
With the id seat_row_column and i was wondering if it would be better to save all checked instances to an array, then all non-checked instances and save to another array.Finally loop to save to database meaning that each one would create a record of it's own with details accordingly.
Or would it be better that every r开发者_如何学JAVAecord that is read is saved at that instance to db, although i think that this would cause a lot of open close connections to the database besides other lag please would really like any suggestions.
If you can batch read and writes, this is a better design.
One of the more expensive overheads is establishing a connection, so if you can utilize a single connection for all the data, this will be more scalable.
Assign each seat a seat number. As the user checks the seat on a display (which will show booked and non-booked seats), you simply save the users info and seat number to the database. You don't need to get too tied to any matrix here.
Your connections are pooled and this should not be a problem. Save per user.
Do it in one if you can...If there isn't isDirty method already, you could create a custom checkbox control with an isDirty method, then check for this and update only those that have changed.
精彩评论