Hibernate Boot

Asked

Viewed 275 times

2

You can disable the check that Hibernate does every time the app starts?

That is, at the time I create the table classes and I create the columns, it is normal that the first time the app runs Hibernate create the tables according to entities set.

However, from this, every time the app is run it continues to check the tables, and none has been changed, so I lose speed in the app initiation.

Below an example of checking...

set 29, 2014 5:34:33 PM org.hibernate.ejb.HibernatePersistence logDeprecation
WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
set 29, 2014 5:34:34 PM org.hibernate.ejb.HibernatePersistence logDeprecation
WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
set 29, 2014 5:34:34 PM org.hibernate.ejb.HibernatePersistence logDeprecation
WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
set 29, 2014 5:34:34 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [
    name: casa
    ...]
set 29, 2014 5:34:34 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.6.Final}
set 29, 2014 5:34:34 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
set 29, 2014 5:34:34 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
set 29, 2014 5:34:35 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
set 29, 2014 5:34:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)
set 29, 2014 5:34:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://192.168.1.199/casadochopp]
set 29, 2014 5:34:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000046: Connection properties: {user=root, password=****}
set 29, 2014 5:34:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000006: Autocommit mode: false
set 29, 2014 5:34:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
set 29, 2014 5:34:37 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
set 29, 2014 5:34:38 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.people
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [address, mail, city, phone, cpf, name, id, cnpj, sexo, type]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.settings
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [idsettings, cardstart, cardend]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.comandas
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [people_id, codcom, datecom, desconto, hourcom, card, status]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_bnw9l1qcofp9oyvm9ge9rktkp]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_bnw9l1qcofp9oyvm9ge9rktkp, primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.itens_comandas
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [namepro, coditen, qtdpro, comanda_codcom, valorpro, product_codpro]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_rmbxevv5ruo62sa34wgdmga41, fk_6038pgoa0827b30p9abx9qqbo]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_rmbxevv5ruo62sa34wgdmga41, fk_6038pgoa0827b30p9abx9qqbo, primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.itens_nota
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [coditensnote, qtd, note_codnote, cost, product_codpro]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_ac1tn94l5w66ul77d1nbme6b8, fk_98jgeuv3wtt1vobumpjva7ujq]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_ac1tn94l5w66ul77d1nbme6b8, fk_98jgeuv3wtt1vobumpjva7ujq, primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.notes
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [numnote, people_id, datanote, dataent, shippnote, totalnote, codnote, despesasnote]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_h7em46letmwtmko1di56kbqpl]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_h7em46letmwtmko1di56kbqpl, primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.products
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [namepro, vigorprice, price2pro, category_codpcat, descriptionpro, costpro, codpro, price1pro, stockpro]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_s8p92nu65sd00m7kooorw3dl3]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_s8p92nu65sd00m7kooorw3dl3, primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.products_category
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [productcategory, codpcat, categorydescription]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.users
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [nameuser, passuser, tipuser, coduser, namecat, categoria_coducat]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: [fk_cpj6mheomcmqjq5lcpi4l6xyw]
set 29, 2014 5:34:41 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [fk_cpj6mheomcmqjq5lcpi4l6xyw, primary]
set 29, 2014 5:34:42 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: casadochopp.users_category
set 29, 2014 5:34:42 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [coducat, levelucat, nameucat]
set 29, 2014 5:34:42 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
set 29, 2014 5:34:42 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
set 29, 2014 5:34:42 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete

1 answer

2


You probably have the configuration property hibernate.hbm2ddl.auto in some configuration file.

Just remove or comment on the above setting so that Hibernate no longer checks.

Apparently, second an answer on Soen, it is also possible to use the value none for this property, however it is not recommended since is not in the documentation.

  • 1

    Thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.