Design question - long transaction

Hey,

My client is a swt client that runs on machine A and the server is a J2ee server that runs on machine B.

We use facade design pattern and the API are exposed to the client as a stateless session bean.

The user does some configuration changes.

for change (like add new components ... ) we need to go to the server in order to create or edit the component (the client doesn't have the knowledge how to do this)

in the end of the configuration process the user may press on the persist button and all the changes need to be persist.

The concept that I need to implement is similar to the concept of editing word document all the changes are saved in temporal document until the user click on save or close the document.

As I see it I need long transaction here, but stateless doesn't support in long transaction and there are a lot of problems (time out and etc) in a long transaction.

I have to save those "temporal configurations" to the DB, because I need to get id for these configurations and other operations.

Does any one have an idea how to implement it?

It is important to remember that if the user edit an existing component other user don't see those changes unless he press on the save button. This scenario can lead to conflict.

Thank you.

Any idea will be welcomed.

[1363 byte] By [AvihaiMara] at [2007-11-27 3:27:28]
# 1
Cache the changes made by the user. Save the changes to db only if the user press the save button.
enigma_y2k1a at 2007-7-12 8:30:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thank you for your answer, but i need to persist the changes for the following reasons:

1. I am using ORM , i need the id in oder to control on the references between objects.

if the client create new objcet i need to give him an id in order to query this object.

2. if i change object it reflect on other objcets so i need to save it to the DB.

3. i dont want that i will lose all the information in case that the server crash.

Any idea wil be more than welcome.

Thank you

AvihaiMara at 2007-7-12 8:30:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...