This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Strange Behavior of Hibernate - NOT RESPONDING Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Strange Behavior of Hibernate - NOT RESPONDING" Watch "Strange Behavior of Hibernate - NOT RESPONDING" New topic
Author

Strange Behavior of Hibernate - NOT RESPONDING

Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
I am running Emp-Dept one-to- many example with Eclipse 3.2 and hibernate3.2 When I run the cclient, hibernate is not responding. It is just printing the following message on the console....

Starting ..
Saving data for Emp..
Hibernate: select emp_.empno, emp_.deptno, emp_.sal as sal0_, emp_.loc as loc0_ from EMP emp_ where emp_.empno=? and emp_.deptno=?
Hibernate: insert into DEPT (deptname, empno, deptno) values (?, ?, ?)

When I am taking out the relationship its working fine, if somethng is wrong with mapping or somewhere else ... why Hibernate is not complaing abt error rather than sitting quit??? And, thread is ALIVE.

Below is code.
Dept.java
---------------------------------------------------------------


DeptKey.java (Composite PK Class)
---------------------------------------------------------------


Emp.java
---------------------------------------------------------------


EmpKey.java
---------------------------------------------------------------


dept.hbm.xml
---------------------------------------------------------------


emp.hbm.xml
---------------------------------------------------------------


Client.java
---------------------------------------------------------------



-----------------------------------------

SQL> desc emp
Name Null? Type
----------------------------------------- -------- ----------------
EMPNO NOT NULL VARCHAR2(10)
DEPTNO NOT NULL VARCHAR2(10)
SAL VARCHAR2(10)
LOC VARCHAR2(10)

Note : empno and deptno is PK there is no FK


SQL> desc dept
Name Null? Type
----------------------------------------- -------- -----------------------
EMPNO NOT NULL VARCHAR2(10)
DEPTNO NOT NULL VARCHAR2(10)
DEPTNAME VARCHAR2(10)

Note : empno and deptno is PK there is no FK


Please share your idea on this.
Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
Tried to run from the command prompt just adding hibernate jar in the classpath but did not help.

Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
Finally, I am able to run it successfully. In the background my Oracle SQL Plus window was open, the moment I close and rerun it run successfully. I tried to diagnose the problem in different ways.
The problem happens only when I issued delete on both EMP and DEPT and let the SQL editor run in the background -> then tried to run -> it failed.
Once record is inserted, keep the sql window open it does not hurt hibernate.

But, am I only the person who get this kind of person ???

Its really weird ....
Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
But, am I only the person who get this kind of problem???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange Behavior of Hibernate - NOT RESPONDING
 
Similar Threads
Derived Property issue in Hibernate
Invocation of init method failed; nested exception is net.sf.cglib.core.CodeGeneration
Please suggest on this Mapping
Confusion when joining two tables
onetomany - hibernateTemplate