Switching databases almost "runtime" using dhis2 live system tray UI

PS using Live for modifying hibernate.properties (and thus a low-key change-of-database as required in SA) and update war file are great ideas, lets start a new thread for these.

Hi,

I like this seemingly simple fix to a complex problem. While we could look at more advanced solutions to switching databases runtime at a later stage I think being able to switch between databases using a simple menu in the DHIS2 live system tray will help a lot to system admins and implementers that frequently need to switch databases on their laptops or desktops. If I understand you correctly Lars you suggest that we through the live app UI interaction allow the users to switch database, and in the background that triggers 1) a jetty shutdown + 2) edit/replace hibernate.properties + 3) jetty startup sequence?

We could then with a bit more UI interaction through the live app allow the users to register multiple databases and then provide a switch db menu that lists all registered databases?
How long does it take to shut down and start up jetty? 1 min? It’s not perfect, but simplifies the life of the not-very-technical DHIS2 trainer etc. that needs to work on multiple databases.

Ola

···

PS using Live for modifying hibernate.properties (and thus a low-key change-of-database as required in SA) and update war file are great ideas, lets start a new thread for these.

Hi,

I like this seemingly simple fix to a complex problem. While we could look at more advanced solutions to switching databases runtime at a later stage I think being able to switch between databases using a simple menu in the DHIS2 live system tray will help a lot to system admins and implementers that frequently need to switch databases on their laptops or desktops. If I understand you correctly Lars you suggest that we through the live app UI interaction allow the users to switch database, and in the background that triggers 1) a jetty shutdown + 2) edit/replace hibernate.properties + 3) jetty startup sequence?

Yes that was my first thought.

We could then with a bit more UI interaction through the live app allow the users to register multiple databases and then provide a switch db menu that lists all registered databases?
How long does it take to shut down and start up jetty? 1 min? It’s not perfect, but simplifies the life of the not-very-technical DHIS2 trainer etc. that needs to work on multiple databases.

At my win7 machine startup takes 20 secs and shutdown is instant. So this might be viable…

···

On Thu, Mar 4, 2010 at 3:47 PM, Ola Hodne Titlestad olatitle@gmail.com wrote:

I love this as well… and from all the comments, the world likes it as well!!.. and is fast to swicth databases. Hoots to Bob!!

I was going to make a patch last nite, but sadly I can’t get live to work…

It says the dhis.war is not found at the webapps path?? Does it not need the DHIS2_HOME environment var to be already set… and do I need to remove that thing??

···

Regards,

Saptarshi PURKAYASTHA
Director R & D, HISP India
Health Information Systems Programme

My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE

On 4 March 2010 15:47, Ola Hodne Titlestad olatitle@gmail.com wrote:

PS using Live for modifying hibernate.properties (and thus a low-key change-of-database as required in SA) and update war file are great ideas, lets start a new thread for these.

Hi,

I like this seemingly simple fix to a complex problem. While we could look at more advanced solutions to switching databases runtime at a later stage I think being able to switch between databases using a simple menu in the DHIS2 live system tray will help a lot to system admins and implementers that frequently need to switch databases on their laptops or desktops. If I understand you correctly Lars you suggest that we through the live app UI interaction allow the users to switch database, and in the background that triggers 1) a jetty shutdown + 2) edit/replace hibernate.properties + 3) jetty startup sequence?

We could then with a bit more UI interaction through the live app allow the users to register multiple databases and then provide a switch db menu that lists all registered databases?
How long does it take to shut down and start up jetty? 1 min? It’s not perfect, but simplifies the life of the not-very-technical DHIS2 trainer etc. that needs to work on multiple databases.

Ola


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Saptarshi

I love this as well... and from all the comments, the world likes it as
well!!.. and is fast to swicth databases. Hoots to Bob!!
I was going to make a patch last nite, but sadly I can't get live to
work...
It says the dhis.war is not found at the webapps path?? Does it not need the
DHIS2_HOME environment var to be already set... and do I need to remove that
thing??

The dhis live is targeted at the ignorant and you are too wise! In a
nutshell it does not use DHIS2_HOME (and should ignore it if is there)
and it is designed to use an exploded war in the webapps/dhis
directory (exploding the war was too costly on startup time). I have
been poor in documenting (partly because few people seemed interested
at the start though I see that is changing) but I think Jason has now
done some outstanding work in packaging and documenting.

Does that help? I suspect your problem is that there is no exploded
dhis.war in the webapps/dhis directory. Funny message from jetty
though. Perhaps it is agnostic about whether it finds a war or a
directory. But you do have to put it there yourself (though I think
Jason's changes do this as well now).

Regards
Bob

···

On 4 March 2010 14:55, Saptarshi Purkayastha <sunbiz@gmail.com> wrote:

---
Regards,
Saptarshi PURKAYASTHA
Director R & D, HISP India
Health Information Systems Programme

My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE

On 4 March 2010 15:47, Ola Hodne Titlestad <olatitle@gmail.com> wrote:

PS using Live for modifying hibernate.properties (and thus a low-key
change-of-database as required in SA) and update war file are great ideas,
lets start a new thread for these.

Hi,

I like this seemingly simple fix to a complex problem. While we could look
at more advanced solutions to switching databases runtime at a later stage I
think being able to switch between databases using a simple menu in the
DHIS2 live system tray will help a lot to system admins and implementers
that frequently need to switch databases on their laptops or desktops. If I
understand you correctly Lars you suggest that we through the live app UI
interaction allow the users to switch database, and in the background that
triggers 1) a jetty shutdown + 2) edit/replace hibernate.properties + 3)
jetty startup sequence?

We could then with a bit more UI interaction through the live app allow
the users to register multiple databases and then provide a switch db menu
that lists all registered databases?
How long does it take to shut down and start up jetty? 1 min? It's not
perfect, but simplifies the life of the not-very-technical DHIS2 trainer
etc. that needs to work on multiple databases.

Ola
-----

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

Hi Bob,

···

On 4 March 2010 16:26, Bob Jolliffe bobjolliffe@gmail.com wrote:

Does that help? I suspect your problem is that there is no exploded

dhis.war in the webapps/dhis directory. Funny message from jetty

though. Perhaps it is agnostic about whether it finds a war or a

directory. But you do have to put it there yourself (though I think

Jason’s changes do this as well now).

Nope doesn’t help much… I download the code(/dhis-live), do a mvn assembly:assembly and in the target folder I get only dhis2-live.exe (224KB); dhis2-live.jar (24KB) and dhis2-live-jar-with-dependencies.jar (6.6MB)

Do I do something else, because they seem very small in size to me??

Sorry, but I suspect this is my fault for not changing the read me.

Try mvn package

and everything should be build.

Regards,
Jason

···

On Fri, Mar 5, 2010 at 10:54 PM, Saptarshi Purkayastha sunbiz@gmail.com wrote:

Hi Bob,

On 4 March 2010 16:26, Bob Jolliffe bobjolliffe@gmail.com wrote:

Does that help? I suspect your problem is that there is no exploded

dhis.war in the webapps/dhis directory. Funny message from jetty

though. Perhaps it is agnostic about whether it finds a war or a

directory. But you do have to put it there yourself (though I think

Jason’s changes do this as well now).

Nope doesn’t help much… I download the code(/dhis-live), do a mvn assembly:assembly and in the target folder I get only dhis2-live.exe (224KB); dhis2-live.jar (24KB) and dhis2-live-jar-with-dependencies.jar (6.6MB)

Do I do something else, because they seem very small in size to me??


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190

In case you missed it, you can try and download this as well…

http://www.mediafire.com/download.php?tmmywuorgym

This is a prepackaged version of DHIS 2 Live. It will give you an idea of how things should be setup.

Remember the jar that is produced (with dependencies) needs to be renamed dhis2-live.jar. Not sure why this happens, but the one that results from the build (dhis2-live.jar) does not work.

Regards,
Jason

···

On Fri, Mar 5, 2010 at 11:53 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Sorry, but I suspect this is my fault for not changing the read me.

Try mvn package

and everything should be build.

Regards,
Jason

On Fri, Mar 5, 2010 at 10:54 PM, Saptarshi Purkayastha sunbiz@gmail.com wrote:

Hi Bob,

On 4 March 2010 16:26, Bob Jolliffe bobjolliffe@gmail.com wrote:

Does that help? I suspect your problem is that there is no exploded

dhis.war in the webapps/dhis directory. Funny message from jetty

though. Perhaps it is agnostic about whether it finds a war or a

directory. But you do have to put it there yourself (though I think

Jason’s changes do this as well now).

Nope doesn’t help much… I download the code(/dhis-live), do a mvn assembly:assembly and in the target folder I get only dhis2-live.exe (224KB); dhis2-live.jar (24KB) and dhis2-live-jar-with-dependencies.jar (6.6MB)

Do I do something else, because they seem very small in size to me??


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190

Even then it builds these small files… It should be some 60MB I suppose

···

On 5 March 2010 20:53, Jason Pickering jason.p.pickering@gmail.com wrote:

Sorry, but I suspect this is my fault for not changing the read me.

Try mvn package

and everything should be build.

No, that is correct. Read the INSTALLER-README in the installer folder. It will show you how to piece everything together.

Two files are should be produced and are required.

(1)dhis2-live.exe which on my machine is about 22k kb

(2)dhis2-live-jar-with-dependencies.jar is about 6850 kb.

rename (2) to dhis2-live.jar and unzip the war file into the /webapps/dhis

you will need some other directories as well as detailed in the INSTALLER-README file.

If you get the installer running, it should build everything with the build script.

Regards,
Jason

···

On Sat, Mar 6, 2010 at 12:16 AM, Saptarshi Purkayastha sunbiz@gmail.com wrote:

On 5 March 2010 20:53, Jason Pickering jason.p.pickering@gmail.com wrote:

Sorry, but I suspect this is my fault for not changing the read me.

Try mvn package

and everything should be build.

Even then it builds these small files… It should be some 60MB I suppose

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190