[izpack-users] Automatic Uninstall or Rollback to Previous version if Any Error?
Miraodb
miraodb at hotmail.com
Mon Feb 20 15:36:16 CET 2006
Hi tam,
this is not an easy thing to do !
First of all for the data itself. IzPack currently doesn't rollback (which
means delete folders and files installed, unregister keys....) automatically
when an error raises.
I can imagine that catching any kind of error during install and creating a
listener that would delete everything that has been installed up to now
wouldn't be too hard. I'm sure i'm missing something about that, coz
otherwise it would have been done already.
Nice thing to think about though !
Now, regarding DB. I doubt that you can easely manage DB rollbacks. Many
issues will come up. First of all , which DB are we talking about ? Second
of all, Not all DB transactions requires a commit, which means that rollback
wouldn't change a thing. Furthermore, if any update, insert or whatever
change you make the DB has to be effective it should be followed by a
commit. If the commit is done, then the rollback would be worthless.
At this point, i can only see the possibility to execute a commit ONLY after
everything went well during installation. Which means that you should
probably add an action on the button finish of a finishpanel or even better
create a new custompanel which would do the exact same thing as finishpanel
+ commiting your DB transactions.
This implies that the panel should allow to connect to a db and execute a
query. The best way is probably JDBC but it also means that the panel would
be quite big and very specific. Specific in the sense that you need JDBC
drivers for each kind of DB (oracle, ms, DB2....)
You would probably better use a script for the DB that runs right after
installation or during processpanel.
I explained something similar using JDBC in the Docu. It's in the cookbooks.
Cheers,
fabrice
----- Original Message -----
From: "Tam" <mj.tam at welcome-rt.com>
To: <izpack-users at lists.berlios.de>
Sent: Wednesday, February 15, 2006 4:07 AM
Subject: [izpack-users] Automatic Uninstall or Rollback to Previous version
if Any Error?
> Hi,
>
>
>
> Regarding the subject above, I need some help/advise from you. I have
> successfully built installer by IzPack, but I am not sure whether the
IzPack
> provide any feature on exception handling or automatic rollback when error
> occurs as enhancement. The concern is I would like to include DB patch in
> the installer, and I wish the installer can automatically rollback to
> previous version for both application and DB if any failure. I am not sure
> how can the installer detect error and perform the action I need.
>
> Hope can have your reply as soon as possible.
>
> Thank you.
>
>
>
>
More information about the izpack-users
mailing list