Topic: Help!!! Some problems encountered on Hibernate

  Print this page

1.Help!!! Some problems encountered on Hibernate Copy to clipboard
Posted by: charleszq
Posted on: 2003-10-13 22:26

There is an article on TSS entitled 'Introduction to Hibernate'. I downloaded the code of that article and did some test on my own machine. As to the TeamDAOTest class, it creates an instance of 'Team' and puts 2 'Players' in a HashSet and associate the set to the 'Team' instance, then saves the 'Team' into the database. So, there should be a record of team and 2 records of player inserted into the database table. But I found that only one player was there after I run the test case.

What should be the problem? I tried several times on different machines, but always get the same result. I use MySQL as the DBMS.

Looking forward to your kind reply. Thank you in advance.

The code can be downloaded from http://www.systemmobile.com

2.Re:Help!!! Some problems encountered on Hibernate [Re: charleszq] Copy to clipboard
Posted by: charleszq
Posted on: 2003-10-13 23:37

It seems that if I just run 'ant run-tests' of his thing, there is no problem. But when I tried to write my own test cases according to his code, the problem mentioned above comes up.

Trying to understand the difference of my code and his. >Sad

3.Re:Help!!! Some problems encountered on Hibernate [Re: charleszq] Copy to clipboard
Posted by: tasmin
Posted on: 2003-10-14 12:00

推荐你先将PO做成一个MBean Service,然后在Session Bean 中lookup SessionFactory,这样就不用管理事务了,否则,呵呵。。

4.Re:Help!!! Some problems encountered on Hibernate [Re: charleszq] Copy to clipboard
Posted by: charleszq
Posted on: 2003-10-14 13:12

Sorry, I can not get you. I don't use EJB things, just hibernate. Thank you anyway.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923