Thread: Transaction Aborted

Transaction Aborted

From
"Edwin S. Ramirez"
Date:
Hello,
   This may sound familiar since there was a discussion before...

I created an importing tool which allows users to load data into their 
tables using a graphical interface.
The import operations occur within a transaction so that the user gets a 
chance to change their mind.
After the import is finished the user is presented with a choice to 
"abort", "commit" or interact with the
database.  Interacting with the database allows the user to submit 
queries to verify the data load.

Everything works great except that if the user makes any typos the 
entire transaction is aborted,
requiring the import process to be done again.

I was under the impression that the nested transaction feature would 
make this go away. 
I played a little with it and it seems that the entire transaction is 
aborted even if a checkpoint is
created.

Could someone please help me with this?

-Thanks,
Edwin S. Ramirez



Re: Transaction Aborted

From
Jeff Davis
Date:
I think that the feature you're looking for is a SAVEPOINT.

After the import, create a savepoint, and then if the user makes a typo
revert to that savepoint.

Regards,Jeff Davis

On Sun, 2005-02-20 at 22:05 -0500, Edwin S. Ramirez wrote:
> Hello,
> 
>     This may sound familiar since there was a discussion before...
> 
> I created an importing tool which allows users to load data into their 
> tables using a graphical interface.
> The import operations occur within a transaction so that the user gets a 
> chance to change their mind.
> After the import is finished the user is presented with a choice to 
> "abort", "commit" or interact with the
> database.  Interacting with the database allows the user to submit 
> queries to verify the data load.
> 
> Everything works great except that if the user makes any typos the 
> entire transaction is aborted,
> requiring the import process to be done again.
> 
> I was under the impression that the nested transaction feature would 
> make this go away. 
> I played a little with it and it seems that the entire transaction is 
> aborted even if a checkpoint is
> created.
> 
> Could someone please help me with this?
> 
> -Thanks,
> Edwin S. Ramirez
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly