Hibernate skills

xiaoxiao2021-03-05  44

Hibernate three tips

1. Improve Hibernate Running Speed ​​2. Transaction Management Error 3.log Error

Hibernate three small doors:

1. Improve Hibernate running speed: ""

Change into your location to point to your local Hibernate-Configuration-2.0.dtd file location. For example, me is:

" "

2. Transaction management error: When the line is similar to "javax.naming.noinitialcontextexception: Need to specify class name in Environment OR

System Property, or as an applet parameter, or in an application resource file:

Java.naming.Factory.initial "or" Net.sf.hibernate.TranSActionException: Could Not Find UserTransaction in JNDI: "This is the transaction management mechanism is not set correctly. We generally use jdbcTransaction, but hibernate.cfg.xml It may be configured to jTATRRANSACTION. As long as you: "

Name = "hibernate.transaction.factory_class> Net.sf.hibernate.Transaction.jtatransActionFacto

RY "changed:" PROPERTY

Name = "hibernate.transaction.factory_class"> net.sf.hibernate.transaction.jdbctransactionFactionFactionFactionFactionFactionFactionFactionFaction

Ory "

3.Log Error: System If the error message is "log4j: warn no appenders could be bound for logger (net.sf.hibernate.cfg.environment .log4j: war4j system protecting." Description System Can't find Log4j.properties file, just add this file Copy to the Classes directory; if you are passing "Configuration CFG = New Configuration (). configure ();", you should also

Place the hibernate.cfg.xml file in the class directory.

转载请注明原文地址:https://www.9cbs.com/read-31960.html

New Post(0)