-->
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.  [ 32 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Thanks
PostPosted: Wed Nov 26, 2003 1:20 pm 
Newbie

Joined: Fri Nov 07, 2003 10:58 am
Posts: 14
Location: Albuquerque, NM
Yeah, I remember you saying it needed a flush and forgot to add it. This at least should work.

This will work for me, I think. I think ideally I will do more like what I said (save, null and then restore the date in the object).

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 4:46 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:34 pm
Posts: 36
Location: New York, NY
I've found out some more info, it seems that the order in which the columns are listed in the generated INSERT is the determining factor on which ID, if any, will get corrupted. Specifically, the ID that follows the timestamp in the insert will be the one that has the problem. Now, in my case I can work it so that no numeric IDs directly follow the timestamp so I can avoid the problem, but your schema may not allow this.

The two things you need to do to fiddle around with this are to turn on the SQL logging, <property name="show_sql">true</property>, and to change the order of the properties in your entity XML. I moved the timestamp to be the last thing in my entity hbm.xml file and now it's working.

A fully general fix would be to the hibernate EntityPersister and redorder the columns by type, putting all timestamps at the end. I haven't gotten this far yet and I'm not sure there'd be much support to put a change like that into the hibernate core when it's really an Oracle specific fix.

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 11:30 am 
Newbie

Joined: Wed Mar 24, 2004 6:43 pm
Posts: 11
Location: Winnipeg, Manitoba, Canada
The solution of putting the TIMESTAMP datatype column last in the XML file definition doesn't work for me. However, if I change the column to be a DATE in the XML file it will work - except it doesn't insert the TIME, only the DATE. I do need the TIME.

Have there been any fixes to Hibernate pertaining to this issue?

Aslo, are there any other work arounds besides inserting and then updating? (I can't do this unless I chane my data model since my timestamp field is NOT NULL)

Lastly, what is the exact cause of the problem (Oracle or Hibernate core)?

_________________
- Dylan Milks


Top
 Profile  
 
 Post subject: Still unresolved to my knowledge
PostPosted: Tue Mar 30, 2004 12:22 pm 
Newbie

Joined: Fri Nov 07, 2003 10:58 am
Posts: 14
Location: Albuquerque, NM
I am the one who posted the original issue... Yes, I am still having the problem but others here doing the same thing are not having the problem. It was suggested that it might be a bug in the Oracle driver, but having tried old and new drivers alike the issue was not resolved. I don't think anybody really knows what causes this problem, specifically. The only solution I have come up with is the insert null and update, which is a HORRIBLE solution (but works in my app). I also need times and dates in my field and wish somebody could determine the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 1:47 pm 
Newbie

Joined: Wed Mar 24, 2004 6:43 pm
Posts: 11
Location: Winnipeg, Manitoba, Canada
I've figured out what the problem was for me. I replaced the Oracle JDBC driver with the previous version. I'm using Oracle 8.1.7.0.0 and OC4J 9.0.3. Everything works fine for me now!

_________________
- Dylan Milks


Top
 Profile  
 
 Post subject: What drivers specifically?
PostPosted: Wed Mar 31, 2004 6:30 pm 
Newbie

Joined: Fri Nov 07, 2003 10:58 am
Posts: 14
Location: Albuquerque, NM
Can you detail what drivers you are using specifically? I am looking at

http://otn.oracle.com/software/tech/jav ... index.html

and I don't see which driver you are talking about.

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 31, 2004 6:37 pm 
Newbie

Joined: Wed Mar 24, 2004 6:43 pm
Posts: 11
Location: Winnipeg, Manitoba, Canada
The driver that works is the one that came with OC4J 9.0.3. I have no way of knowing which version the driver is. All I can say is that it is called "classes12dms.jar" and it has a size of 1.10 MB. The one that I had originally installed - the one that didn't work - had a size of 1.15 MB (same name).

Other than that, I'm not sure what else I can tell you. Unless you want me to e-mail you the JAR file.

_________________
- Dylan Milks


Top
 Profile  
 
 Post subject: Please email it...
PostPosted: Wed Mar 31, 2004 6:41 pm 
Newbie

Joined: Fri Nov 07, 2003 10:58 am
Posts: 14
Location: Albuquerque, NM
Yes, please email it to me...

kevin@dorffweb.com

Thanks.
Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 8:58 am 
Newbie

Joined: Fri Feb 20, 2004 10:55 am
Posts: 13
kdorff, I'm having the same problem with sequence generation. Any news about?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 6:04 am 
I am currently experiencing similar problems with an Oracle 8.1.6 server.
The problem does not occur with in Oracle9 server. Never tried with 8.1.7...

I am using hibernate 2.1 and ojdbc14.jar - thin mode

I notice that writing into fields of type DATE in Oracle 8.1.6
leads to the introduction of very strange chars in other columns...
When commenting the date column in the mapping file, the insert is OK.

I tried without success to force the type (e.g: <column type="x" where x = date, timestamp, java.util.Date, java.sql.Date, java.sql.Timestamp, etc...) of my date column in the mapping file, but it does not work
with any of the type listed above :-(

Probably a bug in Oracle 8.1.x...


Top
  
 
 Post subject:
PostPosted: Mon May 17, 2004 4:49 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:34 pm
Posts: 36
Location: New York, NY
Did anyone ever confirm the driver change fix for this problem? It's reared it's head for me again on Oracle 8.1.7 and was wondering if anyone had a reliable fix for it now?

Thanks alot,

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 11:27 pm 
Beginner
Beginner

Joined: Fri Mar 05, 2004 6:33 pm
Posts: 29
Location: Vancouver, BC, Canada
I had the same problem. It went away when I upgraded the oracle 8.1 DB server to the latest patches.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 11:02 am 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:34 pm
Posts: 36
Location: New York, NY
Are there releases after 8.1.7, I can't find any updates or patches beyond that version number on the Oracle site.

Thanks for any info.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 11:35 am 
Here are the latest patches - per version and OS:

http://otn.oracle.com/support/patches.htm


Top
  
 
 Post subject:
PostPosted: Tue May 18, 2004 4:57 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:34 pm
Posts: 36
Location: New York, NY
Thanks for the tip, I can confirm that 8.1.7.4 has appeared to fix the problem.

Thanks for all your help everyone.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 32 posts ]  Go to page Previous  1, 2, 3  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.