Menu
  • HOME
  • TAGS

hibernate configuration file and SessionFactory

java,hibernate,oracle11g,sessionfactory,hibernate.cfg.xml

i have found the problem it is inside the hibernate.cfg.xml file. i copied it from the offical hibernate 4.3.9 files. This section is wrong. <property name="hibernate.connection.password" />password</property> there should not be a "/" on the left side where password is meant to be put in....

How to create SessionFactory using Hibernate4 and Spring?

java,spring,hibernate,sessionfactory

First, you are not using spring at all in your example, because main in HibernateTest does not try to bootstrap a Spring application context. What happens is simply that you declare a hibernate session factory, do not initialize it, and try to use it. So yes Netbeans is right, variable...

java.lang.NullPointerException in session factory building hibernate 4

java,hibernate,session,sessionfactory,hibernate-4.x

Did you try adding these properties in xml file: name="hibernate.temp.use_jdbc_metadata_defaults" value="false" name = "hibernate.jdbc.lob.non_contextual_creation" ="true"...

Hibernate null pointer exception

spring,hibernate,jsp,spring-mvc,sessionfactory

When you write new DisplayStatsDAO() in your jsp, it is initialized outside of the Spring container's context. Spring has no way of injecting Session into the DAO.

Java DataSource SessionFactory

java,hibernate,datasource,sessionfactory

Datasource maintains the pool of connections, establishes the connection, knows how to connect etc., User configures data source either in the server(like websphere/weblogic) or in the spring/hibernate configuration file. Either way you give the handle of this data source to the sessionfactory during the app startup. SessionFActory is an interface...

SessionFactory Object Creation using persistance class default constructor

hibernate,sessionfactory

Hibernate tries to create a bean and it does it via reflection. It does the object creation by calling the no-arg constructor, and then using the setter methods to set the properties. You can't use a bean that doesn't have a no-arg constructor. If you don't have a default constructor...

failed to create sessionfactory: annotationConfiguration instance is required

hibernate,exception,gwt,rpc,sessionfactory

Now I solved the problem. If you use hibernate version 4.1.0 instead of hibernate4.3.5 there is no problem anymore.

Speed up the NHibernate SessionFactory create process

nhibernate,fluent-nhibernate,sessionfactory,uptime

Couple of comments that might help you. You can serialise your sessionfactory after its been built. See this blog post for more info. Or Google serialise sessionfactory nhibernate as there are alot of articles If this is a web site then I would always make sure it is spun up...

Session and session factory in hibernate

java,hibernate,session,sessionfactory

The most important thing: never ever create more than one SessionFactory per application (unless you have more than one persistence-context, then create one per appplication and persistence-context). Keeping creating SessionFactories will first kill your performance and then your app-server due to OutOfMemoryErrors. Create a SessionFactory at application startup and keep...