facebook

HibernateSessionFactory.currentSession exception

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #240037 Reply

    Riyad Kalla
    Member

    Marc,
    Can I see how you DDL for your vip data table? Also posting your hbm.xml file for the VIPData object is helpful.

    #240040 Reply

    Marc Siramy
    Member

    Right,
    what do you mean by DLL ?

    This is my hbm.xml file:

    
     <?xml version="1.0" encoding='UTF-8'?>
    <!DOCTYPE hibernate-mapping PUBLIC
                                "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
                                "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
    <!-- DO NOT EDIT: This is a generated file that is synchronized -->
    <!-- by MyEclipse Hibernate tool integration.                   -->
    <!-- Created Thu Oct 20 01:13:25 CEST 2005                         -->
    <hibernate-mapping package="com.nscorp.hibernate">
        <class name="Vipdata" table="vipdata">
            <id name="vipId" column="vip_id" type="java.lang.Integer">
                <generator class="native"/>
            </id>
            <property name="vipName" column="vip_name" type="java.lang.String" />
            <property name="vipTitle" column="vip_title" type="java.lang.String" />
        </class>
    </hibernate-mapping>
    
    
    #240045 Reply

    Riyad Kalla
    Member

    I wanted to see the c reate table statement for your vipdata table. You likely won’t be able to post the entire statement as our forusm filter out SQL code to avoid exploits, so you might need to just copy and paste the column defs from out of the generate creation code.

    #241273 Reply

    dhiraj31
    Member

    Can some one please help me wiht this problem I am struck here for 2 days and I am new to hibernate. I have seen that many people have posted this question but no has posted any solution.

    thank you in advance

    #241274 Reply

    dhiraj31
    Member

    @dhiraj31 wrote:

    I have the same problem

    Could not compile the mapping document
    duplicate import:

    Can some one please help me wiht this problem I am struck here for 2 days and I am new to hibernate. I have seen that many people have posted this question but no has posted any solution.

    thank you in advance

    #241301 Reply

    Riyad Kalla
    Member

    dhiraj31,
    Please tell us the information from MyEclipse > About > Configuration Summary menu, then paste your exception in heree along with your hibernate.cfg.xml file and your hbm.xml file of the offending class.

    #241872 Reply

    dennisrjohn
    Member

    I too was having the same duplicate import problem. I noticed that it was occurring with very generically named classes like “Person” and that got me wondering.

    After looking through the hibernate mappings documentation, I found a setting that is called auto-import, which searches the classloader for the class in the mapping file (ignoring package structures).

    In the mapping file for your class, add auto-import=”false” as such:

    <hibernate-mapping package=”com.test.db.hibernate” auto-import=”false”>

    <class name=”Person” table=”PERSON”>
    <id name=”personId” column=”PERSON_ID” type=”java.lang.Long”>
    <generator class=”sequence”>
    <param name=”sequence”>PERSON_ID</param>
    </generator>
    </id>

    <property name=”firstName” column=”FIRST_NAME” type=”java.lang.String” not-null=”true” />
    <property name=”lastName” column=”LAST_NAME” type=”java.lang.String” not-null=”true” />

    <set name=”scheduleItemSet” inverse=”true”>
    <key column=”PERSON_ID”/>
    <one-to-many class=”ScheduleItem”/>
    </set>
    </class>

    </hibernate-mapping>

    That’ll fix it. It did for me at least.

    #241875 Reply

    Riyad Kalla
    Member

    Thank you for posting here dennis to help the other folks having this problem.

Viewing 8 posts - 16 through 23 (of 23 total)
Reply To: HibernateSessionFactory.currentSession exception

You must be logged in to post in the forum log in