Oracle Editioning Views and JPA or Hibernate -
my application uses 7 , oracle 11g. i'm looking forward achieve 0 downtime during deployments. deployment involves ear deployments , ddl/dml changes oracle db. question focuses on no downtime oracle db during ddl/dml upgrade , supporting new data definition in java ee application.
one of team here has achieved using oracle editioning views (edition based revision) layer each table. application uses jpa , hibernate. i've conducted small poc create entities editioning views; seems jpa or hibernate not support them.
is there information available using editioning views jpa or hibernate?
i suggest @ liquibase allow application keep own database uptodate.
if use spring it's easy, need spring bean :
@bean public springliquibase liquibase() { log.debug("configuring liquibase"); springliquibase liquibase = new springliquibase(); liquibase.setdatasource(datasource()); liquibase.setchangelog("classpath:config/liquibase/master.xml"); liquibase.setcontexts("development, production"); return liquibase; }
then have change log:
databasechangelog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> <changeset id="1" author="bob"> <createtable tablename="department"> <column name="id" type="int"> <constraints primarykey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> <column name="active" type="boolean" defaultvalueboolean="true"/> </createtable> </changeset> </databasechangelog>
each time application starts check if there changes need applying.
Comments
Post a Comment