-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: problem using hibernate3.0alpha against mysql4.1.1
PostPosted: Thu Nov 18, 2004 6:48 pm 
Newbie

Joined: Thu Nov 18, 2004 6:39 pm
Posts: 5
I installed hibernate(version 3.0alpha) on my WindowsXP box. I tried to use command line build eg to build examples. The database used is mysql4.1.1.

but it failed!

it says:

[java] Hibernate: select auctionite0_.id as id0_, bids1_.id as id1_, user2_
.id as id2_, auctionite0_.description as descript2_0_0_, auctionite0_.ends as en
ds0_0_, auctionite0_.condition as condition0_0_, auctionite0_.seller as seller0_
0_, auctionite0_.successfulBid as successf6_0_0_, bids1_.amount as amount1_1_, b
ids1_.`datetime` as y4_1_1_, bids1_.bidder as bidder1_1_, bids1_.item as item1_1
_, bids1_.isBuyNow as isBuyNow1_, user2_.userName as userName2_2_, user2_.`passw
ord` as y3_2_2_, user2_.email as email2_2_, user2_.firstName as firstName2_2_, u
ser2_.`initial` as y6_2_2_, user2_.lastName as lastName2_2_, bids1_.item as item
__, bids1_.id as id__ from AuctionItem auctionite0_ left outer join Bid bids1_ o
n auctionite0_.id=bids1_.item left outer join AuctionUser user2_ on bids1_.bidde
r=user2_.id order by auctionite0_.ends desc limit ?
[java] 17:23:30,578 WARN JDBCExceptionReporter:38 - SQL Error: 1064, SQLSt
ate: 42000
[java] 17:23:30,578 ERROR JDBCExceptionReporter:46 - Syntax error or access
violation message from server: "You have an error in your SQL syntax. Check th
e manual that corresponds to your MySQL server version for the right syntax to u
se near '?' at line 1"

Does anybody know what's wrong here?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 3:49 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Its an alpha version.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 5:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
In other words:

if you want to learn and try Hibernate - then go for Hibernate 2

Hibernate 3 is for experienced users who likes to explore the new (and still not finalized thus the core might contain buggy) features...

Note: I use Hibernate 3 daily and haven't seen such problems, so maybe it's just that the eg example is not uptodate/compatible with mysql....try to run the now much better and usefull to learn unit tests (IIF you want to continue living on the edge with H3 ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 7:04 am 
Newbie

Joined: Tue Nov 16, 2004 6:52 pm
Posts: 3
Two things look interesting.

The first is in the 'order by' clause (ie "order by auctionite0_.ends desc limit ? "), what is 'limit ?', is that the max results you want returned, eg criteria.setMaxResults(5); ? Try removing it and see what happens.

The second is how did you add in the single quotes that show up around some of the field names (eg bids1_.`datetime` ). That may be another thing you could check.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 7:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i don't think it's smith's code he is running -
it's hibernate's eg example that does this on his mysql.

..btw, have you configured eg to use the proper dialect ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 3:09 pm 
Newbie

Joined: Thu Nov 18, 2004 6:39 pm
Posts: 5
It's not my code. I just tried to compily the example comed up with hibernate.

Am I supposed to change dialect in the eg? How to change it?

Thanks everyone who replied.

smith.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 3:10 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Is there a reason you can't use Hibernate2?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 3:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Read http://hibernate.org/152.html

It applies for both hibernate 2 and 3.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 5:39 pm 
Newbie

Joined: Thu Nov 18, 2004 6:39 pm
Posts: 5
I followed the steps it said on the webpage http://hibernate.org/152.html. then, I got the error message.

There is no paticular reason not to use hibernate2. because it is not used in real project, so i'd like to try the lastest version. Anyway, if hibernate doesn't work for me, I will go back to hibernate2.

Thanks for your reply and patient.

Regards,

smith.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 5:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...and you used the correct Dialect ?

And yes - if you just want to use Hibernate for learning then use Hibernate2.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 23, 2004 3:50 pm 
Newbie

Joined: Thu Nov 18, 2004 6:39 pm
Posts: 5
I tried hibernate2.1.7b against mysql4.1.1. It still doesn't work.

I have changed hibernate.properties file to use mysql config and comment out the HypersonicSQL config.

Did anybody really run "build eg" successfully on hibernate against mysql4.1.1?

Regards,

smith.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 23, 2004 3:52 pm 
Newbie

Joined: Thu Nov 18, 2004 6:39 pm
Posts: 5
forgot to say that the error is as same as using hibernate3alpha.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 23, 2004 5:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - don't know how many db's eg has been tested on.

It works on oracle at least ;)

If you need some tutorial stuff go check on hibernate.org under documentation - there is lots of other demos ...

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.