Opened 10 years ago
Closed 10 years ago
#1892 closed task (fixed)
Implement support for extensions to add their own tables the BASE database
Reported by: | Nicklas Nordborg | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | major | Milestone: | BASE 3.4 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
Main use case so far is the LabEnv extension (http://baseplugins.thep.lu.se/wiki/net.sf.basedb.labenv) which currently uses an SQLLite database. The problems with this is that it is using native code which doesn't work well with classloaders that re-load new versions without restarting the server.
Also, in the future it is possible that other extensions may need this feature.
The basic idea is that the Services
extension point is extended with functionality for an extension to specify a database schema (separate from the BASE default schema) and tables that it needs. Note that we only support this as a standalone feature. Relations and links to BASE items are not implemented.
Change History (6)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
(In [6631]) References #1892: Implement support for extensions to add their own tables the BASE database
Adding support for extensions to specify a schema version of their own part of the database. This allows the BASE core to only do the database schema update when the schema version changes resulting in faster startup time for extensions.
The support is implemented by adding an 'app_id' column to the SchemaVersion
table and adding more entries to it. The BASE core schema version got an id of 'net.sf.basedb.core'.
comment:4 by , 10 years ago
comment:5 by , 10 years ago
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [6630]) References #1892: Implement support for extensions to add their own tables the BASE database
The basic framework is in place. Service extensions now get a
ServiceSessionControl
instance in theClientContext.getSessionControl()
. It providesbuildSessionFactory()
method for generating a Hibernate session factory that can be either piggy-backed on BASE transactions (viaDbControl
) and/or use standalone transactions.The
buildSessionFactory()
method also makes sure that the configured database tables are created/updated.