Short question: Has anybody used spring to allow the use of the same session among multiple HttpRequests? Any suggestions for how to best implement this?
Background:
The reason I need this is I have a large object called a Project which has many tickets (1 project to many tickets). A ticket contains a lot of user entered data. A ticket has a one to one relation ship with an Item.
Therefore if I create a new ticket and associate it with an Item, then in another session load the Project to associate the new ticket to it, any pre-existing tickets on the Project could reference the same Item as the new Ticket.
This results in a NonUniqueObjectException (because the same Item object for the new Ticket and any existing Tickets was loaded in different sessions). The only solution to this problem (aside from kludging it up) is a session which spans the entire ticket creation process.
|