Opened 10 years ago
Closed 10 years ago
#706 closed task (fixed)
Update LabEnv to use BASE database capabilties instead of SQLite
Reported by: | Nicklas Nordborg | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | major | Milestone: | LabEnv v1.3 |
Component: | net.sf.basedb.labenv | Keywords: | |
Cc: |
Description (last modified by )
The LabEnv extension currently uses an SQLite database for storing measurements.
BASE 3.4 will include a new feature that allows extensions to get access to part of the database for their own storage needs. See http://base.thep.lu.se/ticket/1892
I think we should drop the SQLite implementation and switch to what BASE provides.
Basically this means we use Hibernate and HQL and configure the LabEnvironmentData
and an @Entity and then replace SQLite-related functionality in LabEnvironmentStorageUtil
class to use Hibernate instead.
It would also be nice if we could automatically import the existing SQLite database to BASE automatically. But this means we will need to keep SQLite around for an extra release.
Change History (10)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Description: | modified (diff) |
---|
comment:3 by , 10 years ago
Milestone: | LabEnv v1.3 → LabEnv v1.x |
---|
comment:4 by , 10 years ago
Milestone: | LabEnv v1.x → LabEnv v1.3 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:5 by , 10 years ago
comment:6 by , 10 years ago
(In [3017]) References #706: Update LabEnv to use BASE database capabilties instead of SQLite
Adding entity class SensorData
which is the bridge between objects and the database. It is mapped with Java Persistence API annotations that are read by Hibernate and converted to a database table.
The LabEnvironment.start()
method uses the supplied ServiceSessionControl
from BASE to configure the mapping to the database and create whatever is needed in the "labenv" schema.
The LabEnvironmentStorageUtil.updateLabEnvDb()
method has been updated to use a SensorData
instance and save that to a Hibernate session instead of using direct SQL.
NOTE! There is currently no transfer of values from an existing SQLite database to PostgreSQL and the query functionality is still on SQLite.
comment:7 by , 10 years ago
comment:8 by , 10 years ago
comment:9 by , 10 years ago
(In [3022]) References #706: Update LabEnv to use BASE database capabilties instead of SQLite
Updated installation documentation.
Delayed the migration so that it takes place the first time the scheduled timer is run. It takes about 30 seconds to process the current production database.
Migraion progress is now written directly to stdout since the logger is most likely configured to not write INFO-level messages.
comment:10 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Have tested this for some time now and it seems to be ok.
(In [3014]) References #706: Update LabEnv to use BASE database capabilties instead of SQLite
Moving around some of the existing code so that it is possible to get access to the
ServiceSessionControl
that is supplied by BASE.