Long Transactions

View: New views
4 Messages — Rating Filter:   Alert me  

Long Transactions

by Mark Robinson-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey everybody,

We're trying to figure out a good way to use some sort of long
transaction system.  What we'd like to be able to do is allow users to
work with a set of entities for 15-30 minutes and then let them commit
the whole process rather than commit each entity separately.  Ideally
we'd like to be able to save their work part-way through so that it is
lost if they lose their connection or their system crashes.

Does anyone have any suggestions on how they would implement something
like this?

Mark

--
Mark Robinson, EIT - Mizar LLC
mark.robinson@...
111-1010 McKenzie Ave.
Victoria, BC
V8X 4B2
(360) 296-4125

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Long Transactions

by Michael Bar-Sinai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had a similar issue with importing things into the db (i.e only INSERT/UPDATE instructions).
I kept manual track of what was inserted, which allowed me to rollback the actions on demand - basically that's the command pattern, where all the commands are persisted to the DB, and each command execution is in a single db transaction.

-Michael

On Sat, Nov 7, 2009 at 7:12 AM, Mark Robinson <mark.robinson@...> wrote:
Hey everybody,

We're trying to figure out a good way to use some sort of long transaction system.  What we'd like to be able to do is allow users to work with a set of entities for 15-30 minutes and then let them commit the whole process rather than commit each entity separately.  Ideally we'd like to be able to save their work part-way through so that it is lost if they lose their connection or their system crashes.

Does anyone have any suggestions on how they would implement something like this?

Mark

--
Mark Robinson, EIT - Mizar LLC
mark.robinson@...
111-1010 McKenzie Ave.
Victoria, BC
V8X 4B2
(360) 296-4125

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Long Transactions

by Mark Robinson-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the idea Michael.

I was thinking of either building a list of command objects that I
haven't committed or list of operations I've already done and then
information to be able to rollback the changes.  I'm not sure which is
better but I'm thinking of the latter where reverting changes would be
easier.

Mark

Michael Bar-sinai wrote:

> I had a similar issue with importing things into the db (i.e only
> INSERT/UPDATE instructions).
> I kept manual track of what was inserted, which allowed me to rollback
> the actions on demand - basically that's the command pattern, where
> all the commands are persisted to the DB, and each command execution
> is in a single db transaction.
>
> -Michael
>
> On Sat, Nov 7, 2009 at 7:12 AM, Mark Robinson <mark.robinson@...
> <mailto:mark.robinson@...>> wrote:
>
>     Hey everybody,
>
>     We're trying to figure out a good way to use some sort of long
>     transaction system.  What we'd like to be able to do is allow
>     users to work with a set of entities for 15-30 minutes and then
>     let them commit the whole process rather than commit each entity
>     separately.  Ideally we'd like to be able to save their work
>     part-way through so that it is lost if they lose their connection
>     or their system crashes.
>
>     Does anyone have any suggestions on how they would implement
>     something like this?
>
>     Mark
>
>     --
>     Mark Robinson, EIT - Mizar LLC
>     mark.robinson@... <mailto:mark.robinson@...>
>     111-1010 McKenzie Ave.
>     Victoria, BC
>     V8X 4B2
>     (360) 296-4125
>
>     _______________________________________________
>     eclipselink-users mailing list
>     eclipselink-users@... <mailto:eclipselink-users@...>
>     https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>  


--
Mark Robinson, EIT - Mizar LLC
mark.robinson@...
111-1010 McKenzie Ave.
Victoria, BC
V8X 4B2
(360) 296-4125

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Long Transactions

by Michael Bar-Sinai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mark,
In my case, using a list of un-committed commands was not possible, because it would have been too many changes to contain in a single transaction (got an out of memory error). Even if that is not the case, you may still need to rollback the action list mid-way... if they don't fit in a single transaction you need to support manual rollback anyway.

So, all in all, I'd go with the latter. This works for my project.

Michael

On Mon, Nov 9, 2009 at 11:52 PM, Mark Robinson <mark.robinson@...> wrote:
Thanks for the idea Michael.

I was thinking of either building a list of command objects that I haven't committed or list of operations I've already done and then information to be able to rollback the changes.  I'm not sure which is better but I'm thinking of the latter where reverting changes would be easier.

Mark

Michael Bar-sinai wrote:
I had a similar issue with importing things into the db (i.e only INSERT/UPDATE instructions).
I kept manual track of what was inserted, which allowed me to rollback the actions on demand - basically that's the command pattern, where all the commands are persisted to the DB, and each command execution is in a single db transaction.

-Michael

On Sat, Nov 7, 2009 at 7:12 AM, Mark Robinson <mark.robinson@... <mailto:mark.robinson@...>> wrote:

   Hey everybody,

   We're trying to figure out a good way to use some sort of long
   transaction system.  What we'd like to be able to do is allow
   users to work with a set of entities for 15-30 minutes and then
   let them commit the whole process rather than commit each entity
   separately.  Ideally we'd like to be able to save their work
   part-way through so that it is lost if they lose their connection
   or their system crashes.

   Does anyone have any suggestions on how they would implement
   something like this?

   Mark

   --    Mark Robinson, EIT - Mizar LLC
   mark.robinson@... <mailto:mark.robinson@...>

   111-1010 McKenzie Ave.
   Victoria, BC
   V8X 4B2
   (360) 296-4125

   _______________________________________________
   eclipselink-users mailing list
   eclipselink-users@... <mailto:eclipselink-users@...> ------------------------------------------------------------------------


_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
 


--
Mark Robinson, EIT - Mizar LLC
mark.robinson@...
111-1010 McKenzie Ave.
Victoria, BC
V8X 4B2
(360) 296-4125

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users