• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Strange Behavior of Hibernate - NOT RESPONDING

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tried to run from the command prompt just adding hibernate jar in the classpath but did not help.

 
Xavier George
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But, am I only the person who get this kind of problem???
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic