disappearing tables

This is so weird i am even a bit embarressed sharing on the list but I
have had a very strange morning. I've been trying to set up a new
dhis development environment in windoze (which i know is a bad idea
but anyway ..). What seems to be happening is that dhis, when it
starts up, is clobbering tables in my database. I was using postgres
9 and figured maybe that was too brave so I downgraded back to 8.4.5.
Same issue.

What happens is this: if I start with a blank database, then when
dhis runs the tables are created as normal - 164 of them. But after i
shut down dhis I am left with only 5 timetables -
aggregateddatavalues, aggregateddatasetcompleteness,
aggregatedindicatorvalue, datavaluearchive and
patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169
tables and lots of data) it does the same thing. Clobbers most of my
tables. Interesting while dhis is running I have lots of empty tables
which used to be full plus an oddly named _temp_dataelement table.
Then when I shutdown dhis and look at my db again most of the tables
have just gone and I'm left with the above plus a couple of _resource
tables.

Environment:
dhis.war latest build 1676 - both my own and download from hudson
postgres8.4.5
java 1.6.0_22
tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db
spirits this morning.

Regards
Bob

Can we see the hibernate.properties in use? A long shot: it might be related to the hibernate.hbm2ddl.auto property, usually should be set to “update”.

···

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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

Could well be. I just cut and paste a generic postgres hibernate/c3p0 setup.

hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke
hibernate.connection.username = postgres
hibernate.connection.password = postgres
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers
bob

···

2010/12/14 Lars Helge Øverland <larshelge@gmail.com>:

Can we see the hibernate.properties in use? A long shot: it might be related
to the hibernate.hbm2ddl.auto property, usually should be set to "update".
On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

This is so weird i am even a bit embarressed sharing on the list but I
have had a very strange morning. I've been trying to set up a new
dhis development environment in windoze (which i know is a bad idea
but anyway ..). What seems to be happening is that dhis, when it
starts up, is clobbering tables in my database. I was using postgres
9 and figured maybe that was too brave so I downgraded back to 8.4.5.
Same issue.

What happens is this: if I start with a blank database, then when
dhis runs the tables are created as normal - 164 of them. But after i
shut down dhis I am left with only 5 timetables -
aggregateddatavalues, aggregateddatasetcompleteness,
aggregatedindicatorvalue, datavaluearchive and
patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169
tables and lots of data) it does the same thing. Clobbers most of my
tables. Interesting while dhis is running I have lots of empty tables
which used to be full plus an oddly named _temp_dataelement table.
Then when I shutdown dhis and look at my db again most of the tables
have just gone and I'm left with the above plus a couple of _resource
tables.

Environment:
dhis.war latest build 1676 - both my own and download from hudson
postgres8.4.5
java 1.6.0_22
tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db
spirits this morning.

Regards
Bob

_______________________________________________
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

Options:

  • validate: validate the schema, makes no changes to the database
  • update: update the schema
  • create: creates the schema, destroying previous data
  • create-drop: drop the schema at the end of the session
···

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com

Could well be. I just cut and paste a generic postgres hibernate/c3p0 setup.

hibernate.connection.driver_class = org.postgresql.Driver

hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke

hibernate.connection.username = postgres

hibernate.connection.password = postgres

hibernate.c3p0.min_size=5

hibernate.c3p0.max_size=20

hibernate.c3p0.timeout=1800

hibernate.c3p0.max_statements=50

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers

bob

2010/12/14 Lars Helge Øverland larshelge@gmail.com:

Can we see the hibernate.properties in use? A long shot: it might be related

to the hibernate.hbm2ddl.auto property, usually should be set to “update”.

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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

Good long shot. Included hbm2ddl.auto=true and everything is fine
again :slight_smile: But I've never had to set this before (I see what it does
now). Shouldn't this be coming from one of our base inherited
properties?

···

2010/12/14 Bob Jolliffe <bobjolliffe@gmail.com>:

Could well be. I just cut and paste a generic postgres hibernate/c3p0 setup.

hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke
hibernate.connection.username = postgres
hibernate.connection.password = postgres
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers
bob

2010/12/14 Lars Helge Øverland <larshelge@gmail.com>:

Can we see the hibernate.properties in use? A long shot: it might be related
to the hibernate.hbm2ddl.auto property, usually should be set to "update".
On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

This is so weird i am even a bit embarressed sharing on the list but I
have had a very strange morning. I've been trying to set up a new
dhis development environment in windoze (which i know is a bad idea
but anyway ..). What seems to be happening is that dhis, when it
starts up, is clobbering tables in my database. I was using postgres
9 and figured maybe that was too brave so I downgraded back to 8.4.5.
Same issue.

What happens is this: if I start with a blank database, then when
dhis runs the tables are created as normal - 164 of them. But after i
shut down dhis I am left with only 5 timetables -
aggregateddatavalues, aggregateddatasetcompleteness,
aggregatedindicatorvalue, datavaluearchive and
patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169
tables and lots of data) it does the same thing. Clobbers most of my
tables. Interesting while dhis is running I have lots of empty tables
which used to be full plus an oddly named _temp_dataelement table.
Then when I shutdown dhis and look at my db again most of the tables
have just gone and I'm left with the above plus a couple of _resource
tables.

Environment:
dhis.war latest build 1676 - both my own and download from hudson
postgres8.4.5
java 1.6.0_22
tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db
spirits this morning.

Regards
Bob

_______________________________________________
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

Looks like
*create-drop *is deafult…

···

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com

Good long shot. Included hbm2ddl.auto=true and everything is fine

again :slight_smile: But I’ve never had to set this before (I see what it does

now). Shouldn’t this be coming from one of our base inherited

properties?

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com:

Could well be. I just cut and paste a generic postgres hibernate/c3p0 setup.

hibernate.connection.driver_class = org.postgresql.Driver

hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke

hibernate.connection.username = postgres

hibernate.connection.password = postgres

hibernate.c3p0.min_size=5

hibernate.c3p0.max_size=20

hibernate.c3p0.timeout=1800

hibernate.c3p0.max_statements=50

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers

bob

2010/12/14 Lars Helge Øverland larshelge@gmail.com:

Can we see the hibernate.properties in use? A long shot: it might be related

to the hibernate.hbm2ddl.auto property, usually should be set to “update”.

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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

Looks like create-drop is deafult..

Yup I see it in
./dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties:hibernate.hbm2ddl.auto
= create-drop

I wonder is this the right default to value to have. It gave me a
nasty shock. And could do damage to somebody's production db with a
naive hibernate.properties file like mine :slight_smile:

Either we should set it to 'update' if we want to ease configuration
or to 'validate' if we want to be cautious not to mess peoples
database - or cause them to mess their own.

Thanks for the heads up. Should have asked earlier before turning my
machine upside down.

Cheers
Bob

···

On 14 December 2010 13:33, Jan Henrik Øverland <janhenrik.overland@gmail.com> wrote:

2010/12/14 Bob Jolliffe <bobjolliffe@gmail.com>

Good long shot. Included hbm2ddl.auto=true and everything is fine
again :slight_smile: But I've never had to set this before (I see what it does
now). Shouldn't this be coming from one of our base inherited
properties?

2010/12/14 Bob Jolliffe <bobjolliffe@gmail.com>:
> Could well be. I just cut and paste a generic postgres hibernate/c3p0
> setup.
>
> hibernate.connection.driver_class = org.postgresql.Driver
> hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke
> hibernate.connection.username = postgres
> hibernate.connection.password = postgres
> hibernate.c3p0.min_size=5
> hibernate.c3p0.max_size=20
> hibernate.c3p0.timeout=1800
> hibernate.c3p0.max_statements=50
> hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
>
> Not sure what the hbm2ddl.auto property does. Will look it up.
>
> Cheers
> bob
>
> 2010/12/14 Lars Helge Øverland <larshelge@gmail.com>:
>> Can we see the hibernate.properties in use? A long shot: it might be
>> related
>> to the hibernate.hbm2ddl.auto property, usually should be set to
>> "update".
>> On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe <bobjolliffe@gmail.com> >> >> wrote:
>>>
>>> This is so weird i am even a bit embarressed sharing on the list but I
>>> have had a very strange morning. I've been trying to set up a new
>>> dhis development environment in windoze (which i know is a bad idea
>>> but anyway ..). What seems to be happening is that dhis, when it
>>> starts up, is clobbering tables in my database. I was using postgres
>>> 9 and figured maybe that was too brave so I downgraded back to 8.4.5.
>>> Same issue.
>>>
>>> What happens is this: if I start with a blank database, then when
>>> dhis runs the tables are created as normal - 164 of them. But after i
>>> shut down dhis I am left with only 5 timetables -
>>> aggregateddatavalues, aggregateddatasetcompleteness,
>>> aggregatedindicatorvalue, datavaluearchive and
>>> patientdatavaluearchive. Everything else is just gone :frowning:
>>>
>>> What is worse is that when I start with an existing database (with 169
>>> tables and lots of data) it does the same thing. Clobbers most of my
>>> tables. Interesting while dhis is running I have lots of empty tables
>>> which used to be full plus an oddly named _temp_dataelement table.
>>> Then when I shutdown dhis and look at my db again most of the tables
>>> have just gone and I'm left with the above plus a couple of _resource
>>> tables.
>>>
>>> Environment:
>>> dhis.war latest build 1676 - both my own and download from hudson
>>> postgres8.4.5
>>> java 1.6.0_22
>>> tomcat 6.0.29
>>>
>>> Has anyone else seen something like this or wasI just plagued by db
>>> spirits this morning.
>>>
>>> Regards
>>> Bob
>>>
>>> _______________________________________________
>>> 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

Not sure, but I think this create-drop setting has to do with providing connections to the tests at build time.

Ola,

···

On 14 December 2010 14:52, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 14 December 2010 13:33, Jan Henrik Øverland > janhenrik.overland@gmail.com wrote:

Looks like create-drop is deafult…

Yup I see it in

./dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties:hibernate.hbm2ddl.auto

= create-drop

I wonder is this the right default to value to have. It gave me a

nasty shock. And could do damage to somebody’s production db with a

naive hibernate.properties file like mine :slight_smile:

Either we should set it to ‘update’ if we want to ease configuration

or to ‘validate’ if we want to be cautious not to mess peoples

database - or cause them to mess their own.

Thanks for the heads up. Should have asked earlier before turning my

machine upside down.

Cheers

Bob

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com

Good long shot. Included hbm2ddl.auto=true and everything is fine

again :slight_smile: But I’ve never had to set this before (I see what it does

now). Shouldn’t this be coming from one of our base inherited

properties?

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com:

Could well be. I just cut and paste a generic postgres hibernate/c3p0

setup.

hibernate.connection.driver_class = org.postgresql.Driver

hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke

hibernate.connection.username = postgres

hibernate.connection.password = postgres

hibernate.c3p0.min_size=5

hibernate.c3p0.max_size=20

hibernate.c3p0.timeout=1800

hibernate.c3p0.max_statements=50

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers

bob

2010/12/14 Lars Helge Øverland larshelge@gmail.com:

Can we see the hibernate.properties in use? A long shot: it might be

related

to the hibernate.hbm2ddl.auto property, usually should be set to

“update”.

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com > > >> >> wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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


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

BTW, next time anyone needs to create a new hibernate.properties file the correct/recommended settings are always available here:

http://dhis2.org/development#databasesetup

Ola,

···

On 14 December 2010 15:17, Ola Hodne Titlestad olati@ifi.uio.no wrote:

Not sure, but I think this create-drop setting has to do with providing connections to the tests at build time.

Ola,

On 14 December 2010 14:52, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 14 December 2010 13:33, Jan Henrik Øverland > > janhenrik.overland@gmail.com wrote:

Looks like create-drop is deafult…

Yup I see it in

./dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties:hibernate.hbm2ddl.auto

= create-drop

I wonder is this the right default to value to have. It gave me a

nasty shock. And could do damage to somebody’s production db with a

naive hibernate.properties file like mine :slight_smile:

Either we should set it to ‘update’ if we want to ease configuration

or to ‘validate’ if we want to be cautious not to mess peoples

database - or cause them to mess their own.

Thanks for the heads up. Should have asked earlier before turning my

machine upside down.

Cheers

Bob

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com

Good long shot. Included hbm2ddl.auto=true and everything is fine

again :slight_smile: But I’ve never had to set this before (I see what it does

now). Shouldn’t this be coming from one of our base inherited

properties?

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com:

Could well be. I just cut and paste a generic postgres hibernate/c3p0

setup.

hibernate.connection.driver_class = org.postgresql.Driver

hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke

hibernate.connection.username = postgres

hibernate.connection.password = postgres

hibernate.c3p0.min_size=5

hibernate.c3p0.max_size=20

hibernate.c3p0.timeout=1800

hibernate.c3p0.max_statements=50

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers

bob

2010/12/14 Lars Helge Øverland larshelge@gmail.com:

Can we see the hibernate.properties in use? A long shot: it might be

related

to the hibernate.hbm2ddl.auto property, usually should be set to

“update”.

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com > > > > >> >> wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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


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

Not sure, but I think this create-drop setting has to do with providing connections to the tests at build time.

Yes this is correct and reate-drop is convenient for testing. But we can easily override this.

Nop

Ola,

Looks like create-drop is deafult…

Yup I see it in

./dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties:hibernate.hbm2ddl.auto

= create-drop

I wonder is this the right default to value to have. It gave me a

nasty shock. And could do damage to somebody’s production db with a

naive hibernate.properties file like mine :slight_smile:

Either we should set it to ‘update’ if we want to ease configuration

or to ‘validate’ if we want to be cautious not to mess peoples

database - or cause them to mess their own.

Thanks for the heads up. Should have asked earlier before turning my

machine upside down.

Yes that is a good point. Maybe update is the correct value. The default setup is in-memory H2 so there won’t be much difference between create-drop/update there.

···

On Tue, Dec 14, 2010 at 3:17 PM, Ola Hodne Titlestad olati@ifi.uio.no wrote:

On 14 December 2010 14:52, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 14 December 2010 13:33, Jan Henrik Øverland > > janhenrik.overland@gmail.com wrote:

Cheers

Bob

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com

Good long shot. Included hbm2ddl.auto=true and everything is fine

again :slight_smile: But I’ve never had to set this before (I see what it does

now). Shouldn’t this be coming from one of our base inherited

properties?

2010/12/14 Bob Jolliffe bobjolliffe@gmail.com:

Could well be. I just cut and paste a generic postgres hibernate/c3p0

setup.

hibernate.connection.driver_class = org.postgresql.Driver

hibernate.connection.url = jdbc:postgresql://localhost/dhis2_ke

hibernate.connection.username = postgres

hibernate.connection.password = postgres

hibernate.c3p0.min_size=5

hibernate.c3p0.max_size=20

hibernate.c3p0.timeout=1800

hibernate.c3p0.max_statements=50

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

Not sure what the hbm2ddl.auto property does. Will look it up.

Cheers

bob

2010/12/14 Lars Helge Øverland larshelge@gmail.com:

Can we see the hibernate.properties in use? A long shot: it might be

related

to the hibernate.hbm2ddl.auto property, usually should be set to

“update”.

On Tue, Dec 14, 2010 at 1:52 PM, Bob Jolliffe bobjolliffe@gmail.com > > > > >> >> wrote:

This is so weird i am even a bit embarressed sharing on the list but I

have had a very strange morning. I’ve been trying to set up a new

dhis development environment in windoze (which i know is a bad idea

but anyway …). What seems to be happening is that dhis, when it

starts up, is clobbering tables in my database. I was using postgres

9 and figured maybe that was too brave so I downgraded back to 8.4.5.

Same issue.

What happens is this: if I start with a blank database, then when

dhis runs the tables are created as normal - 164 of them. But after i

shut down dhis I am left with only 5 timetables -

aggregateddatavalues, aggregateddatasetcompleteness,

aggregatedindicatorvalue, datavaluearchive and

patientdatavaluearchive. Everything else is just gone :frowning:

What is worse is that when I start with an existing database (with 169

tables and lots of data) it does the same thing. Clobbers most of my

tables. Interesting while dhis is running I have lots of empty tables

which used to be full plus an oddly named _temp_dataelement table.

Then when I shutdown dhis and look at my db again most of the tables

have just gone and I’m left with the above plus a couple of _resource

tables.

Environment:

dhis.war latest build 1676 - both my own and download from hudson

postgres8.4.5

java 1.6.0_22

tomcat 6.0.29

Has anyone else seen something like this or wasI just plagued by db

spirits this morning.

Regards

Bob


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


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