-->
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.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Hibernate insert wrong value with WAS 4.0.7
PostPosted: Wed Dec 29, 2004 4:37 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
Hibernate version: 2.1.6

I am facing a very weird problem. When I test my program with WebSphere Application Server Single Edition 4.0.7 in my local PC, everything is ok. But when I deploy that program into WebSphere Application Server Advance Edition 4.0.7, hibernate insert and update wrong value to database. in log file, generated query and binding values are all correct.

Is there any one has the same problem?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 5:51 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Damn, you should ask for Murder and Scully support ;-)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 5:59 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
how can I contact them, bro ;-)

Very weird. Because the problem only occurs in WebSphere Application Server Advance Edition 4.0.7. I installed a new WebSphere Application Server Advance Edition 4.0.7 in another PC and deploy the program, the same problem occurs. The program also runs perfectly in WebSphere Studio Application Developer for Windows 4.0.3 (my development environment)

Please help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 6:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
are you sure you're checking the good database?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 6:16 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
The database server has been used for long time.

All the time, I connect to the same database with the same system, the problem only occurs in WebSphere Advance Edition.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 6:25 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
what happen exactly?

you see insert into XXX values (1,2,3) in logs
and when you check in your db client:
- values are not inserted
- or other values are inserted
?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 6:29 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
yes, I saw "insert into xxx values (?,?,?)" and all the binding values are as expected (submitted by user) but other values (radomly) are inserted into database. The same for "update xxx=?, yyy=? where zzz=?"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 6:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
sorry to repeat but check all db parameters in hibernate.cfg.xml and be sure you're checking exactly the same db (user, ip, SID,...)

if it is really the same db, call FBI or i don't know ;)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 10:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If it's really the same DB, then you probably have someting wrong with your JDBC driver (is it the same between the versions?)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 11:51 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Emmanuel,
are you from the FBI? ;))

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 30, 2004 10:16 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
emmanuel wrote:
If it's really the same DB, then you probably have someting wrong with your JDBC driver (is it the same between the versions?)


I also suspected that there're different JDBC drivers. How can I check/config the driver used by hibernate?

Hic... if this problem still cannot be solved, I call FBI then :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 30, 2004 11:20 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You probably are using a datasource so the dirver used, is the one defined in you WAS datasource.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 31, 2004 1:46 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
No. I am using c3p0.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 03, 2005 11:46 pm 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
I think I know why.

I set up 2 databases: one is Oracle 9i and the other one is Oracle 8i (my development database server). When I set up hibernate (hibernate.cfg.xml) to connect to Oracle 9i, eveything is ok. But when I set up to user Oracle 8i, the problem happens.

I downloaded JDBC Driver for Oracle 8.1.7 (from oracle.com) and put in /WEB-INF/lib then the random number inserted to database no longer happens (the correct number is inserted into database). But now a radom string inserted into database (only for one particular field).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 03, 2005 11:53 pm 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
Below is part of log file when I updated one record:
Code:
Hibernate: update T_FIN_BU set DEPT=?, SUBJECT=?, CREATED_BY=?, CREATED_DT=?, LAST_MODIFIED_BY=?, LAST_MODIFIED_DT=? where BU_NO=?
[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.StringType - binding 'PR' to parameter: 1

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.StringType - binding 'Production' to parameter: 2

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.StringType - binding 'fin' to parameter: 3

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-01-04 11:41:58' to parameter: 4

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.StringType - binding 'fin' to parameter: 5

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-01-04 11:41:58' to parameter: 6

[1/4/05 11:41:58:125 SGT] 4467b557 SystemOut     U [04-01-2005 11:41:58] DEBUG net.sf.hibernate.type.LongType - binding '5431' to parameter: 7


One funny string updated to field DEPT instead of 'PR' as binding.

Any one knows why?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

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.