sessionfactory 2 « Session « JPA Q&A





2. Help with custom SessionFactory    forum.hibernate.org

3. Configure SessionFactory    forum.hibernate.org

Hi, I want to change the configuration at runtime ie enable/disable "hibernate.show_sql" property. I see that I can do it thru either xml file or thru configuration object. However, once SessionFactory is created out of configuration object, it will be static forever? Can I can set any properties after SessionFactory is created ? I want to set the "hibernate.show_sql" property after ...

4. How to configure the session factory dynamically ?    forum.hibernate.org

Hi All, Our web application runs on 57 different places (57 session factories and data sources) . Based on the url, my filter class will find which session factory and data source name to use. My question is how to override or set the value of the session factory and data source name dynamically to the hibernate.cfg.xml file (I will know ...

5. SessionFactory issue    forum.hibernate.org

I tried some more debug and found something like this, java.lang.ClassCastException at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:39) at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:580) at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:264) at antlr.TokenBuffer.fill(TokenBuffer.java:69) at antlr.TokenBuffer.LA(TokenBuffer.java:80) at antlr.LLkParser.LA(LLkParser.java:52) at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:139) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:238) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:74) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:53) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1540) at com.xpedx.ecommerce.BaseDAO.findByProperty1(BaseDAO.java:178) at com.xpedx.ecommerce.order.dao.OrderDAO.getOrderBatch(OrderDAO.java:77) at com.xpedx.ecommerce.order.web.OrderUpdateServlet.getBatchId(OrderUpdateServlet.java:343) at com.xpedx.ecommerce.order.web.OrderUpdateServlet.updateOrders(OrderUpdateServlet.java:252) at com.xpedx.ecommerce.order.web.OrderUpdateServlet.doGet(OrderUpdateServlet.java:127) at javax.servlet.http.HttpServlet.service(HttpServlet.java:697) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) ...

6. Can HibernateTransactionManager manage two sessionfactory    forum.hibernate.org

Currently, the application has two sessionfactory for online tables and history tables OrderVO.hbm.xml hibernate.dialect=org.hibernate.dialect.Oracle9Dialect hibernate.format_sql=true hibernate.show_sql=false OrderVO_Hist.hbm.xml hibernate.dialect=org.hibernate.dialect.Oracle9Dialect hibernate.format_sql=true hibernate.show_sql=false But, the transaction manager can reference to ...

7. SessionFactories in SessionFactoryObjectFactory    forum.hibernate.org

Hibernate version: 3.0.5 Hi guys, I have a question about the SessionFactories being stored in the FastHashMap in the SessionFactoryObjectFactory class. Basically, we're seeing that HashMap get up to 200 MB in size which seems very strange... After some researching, I saw that it seems if an app is recycled, the SessionFactory it was using isn't deleted from the HashMap and ...

8. Initial SessionFactory creation failed    forum.hibernate.org

when I'm run my program it show this error Code: Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/dom4j/DocumentException Exception in thread "main" java.lang.ExceptionInInitializerError at util.HibernateUtil.(HibernateUtil.java:30) at hibernate.Main.listEvents(Main.java:47) at hibernate.Main.main(Main.java:33) Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException ...

9. Initial SessionFactory creation failed.org.hibernate.Propert    forum.hibernate.org

Author Message mc1392 Post subject: Initial SessionFactory creation failed.org.hibernate.Propert Posted: Fri May 23, 2008 4:06 pm Beginner Joined: Fri May 16, 2008 3:59 pm Posts: 30 All, I have two classes 1. FinancialAccountId and FinancialAccount. The FinancialAccountId has a composite key:accountnumber,fundname,taxid I keep getting 'could not find getter for texid in FinancialAccount. Why is this: Code: package mybeans; // ...





10. Intial Session Factory Creation Failed.    forum.hibernate.org

11. problem in session factory lookup after certain interval    forum.hibernate.org

Hibernate version: 3.2.6 application server : bea weblogic 9.2. database server : oracle 9i Configuration file: IPRUHA weblogic weblogic org.hibernate.dialect.Oracle9iDialect true org.hibernate.hql.classic.ClassicQueryTranslatorFactory weblogic.jndi.WLInitialContextFactory jta code to look up session factory 1] Code: private static final Properties JNDI_ENV_PROPERTIES = ...

12. Remote SessionFactory, what would it take?    forum.hibernate.org

HI, I'm into rich clients, plus I love hibernate. So I had some investigations how to build a good architecture. Currently I have some remote services that use Eager loading to get my data to the client. I need some extra mappings when I dont want to eager load for performance reasons as I cant change that on the fly (which ...

13. SessionFactory problem    forum.hibernate.org

hi , I have fallowing problem with SessionFactory. When I'm calling method findById iI recive error : 22.09.2008 12:46:03 DAO.AdressenHome getSessionFactory SCHWERWIEGEND: Could not locate SessionFactory in JNDI 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 at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) at ...

14. SessionFactory    forum.hibernate.org

public class User { private long userId = 0 ; private String firstName = ""; private String lastName = ""; private int age = 0; private String email = ""; public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; ...





17. ArrayIndexOutOfBoundsException in SessionFactory    forum.hibernate.org

Hi Guys, Since yesterday we are getting following ArrayIndexOutOfBoundsException in SessionFactoryImpl.get() Quote: java.lang.ArrayIndexOutOfBoundsException: -124 at org.hibernate.impl.SessionFactoryImpl.get(SessionFactoryImpl.java:339) at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:411) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at org.springframework.orm.hibernate3.HibernateTemplate$33.doInHibernate(HibernateTemplate.java:901) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:356) at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:892) at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:882) This is happening for all the master data which is marked as cacheable. All the queries on this master data have this cacheable attribute set to 'true'. There are ...

18. Problem with SessionFactory    forum.hibernate.org

19. Hibernate Session Factory problem    forum.hibernate.org

I am loading hibernate properties from hibernate.properties file and loading mapping files with below metod configuration.addFile("C:\\Tomcat\\apache-tomcat-5.5.26\\webapps\\shad\\WEB-INF\\classes\\hibernate\\SystemMessages.hbm.xml" ); hibernate.properties hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.connection.url=jdbc:mysql://host/config hibernate.connection.username=experts hibernate.connection.password=shad connection.driver_class=com.mysql.jdbc.Driver hibernate.myeclipse.connection.profile=com.mysql.jdbc.Driver hibernate.connection.release_mode=after_statement hibernate.c3p0.acquire_increment=3 hibernate.c3p0.idle_test_period=14400 hibernate.c3p0.timeout=25200 hibernate.c3p0.max_size=30 hibernate.c3p0.min_size=3 hibernate.c3p0.max_statements=0 hibernate.c3p0.preferredTestQuery=select 1; while calling the below statement org.hibernate.SessionFactory sessionFactory=configuration.buildSessionFactory(); i am getting the below exception org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426) at ...

20. Getting a "Building new Hibernate SessionFactory"    forum.hibernate.org

Application Server = JBOSS DB = Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 Dialect: Oracle9FixedSequencesDialect Getting this messge everytime I Acccess the DB. It cuases an increase of 1MB in PermGen Memory. 2009-01-06 18:17:58,098 INFO [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] Building new Hibernate SessionFactory 2009-01-06 18:17:58,122 WARN [org.hibernate.cfg.Environment] Property [hibernate.cglib.use_reflection_optimizer] has been renamed to [hibernate.bytecode.use_reflectio n_optimizer]; update your properties appropriately 2009-01-06 18:17:58,122 INFO [org.hibernate.connection.ConnectionProviderFactory] Initializing ...

21. heap exhaustion using Hibernate 3.0 SessionFactory    forum.hibernate.org

Relevant system configuration: Websphere 6.1.0.17 4 nodes in a cluster/ but only running 1 active node DB2 V9.5 Hibernate 3 for persistence layer.; second level cacheing is disabled. Spring framework for transactionality and MVC for presentation layer. IBM_HTTP_Server/6.1 Apache/2.0.47 IBM WebSphere MQ 7.0.0.1 IBM WebSphere MQ Broker v6.1 Background: We have 4 schemas created in our database for which we ...

22. Determine the size of SessionFactory    forum.hibernate.org

24. Initial SessionFactory creation failed    forum.hibernate.org

SessionFactoryUtil.java import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class SessionFactoryUtil { private static SessionFactory sessionFactory; static { try { // Create the SessionFactory from hibernate.cfg.xml // sessionFactory = new Configuration().configure().buildSessionFactory(); Configuration c= new Configuration(); c.configure(); sessionFactory = c.buildSessionFactory(); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); ...

25. Hibernate SessionFactory: best practice    forums.oracle.com