-->
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.  [ 1 post ] 
Author Message
 Post subject: Corrupt data after committing Oracle Date field
PostPosted: Thu Oct 02, 2008 10:19 am 
Newbie

Joined: Wed Oct 01, 2008 8:45 am
Posts: 1
Hello Everybody,

i'm using Hibernate 3 in combination with a Oracle 8i db.

In my POJO i have the following mapped fields
private String uuid;
private String emailadres;
private String voornaam;
private String achternaam;
private Date geboortedatum;
private String status;
private Date request_datum;
private Date created_datum;
private Date error_datum;
private String erroromschrijving;
private Long enf_relaties_id;
private String nationaliteit;




My problem is when I edit just the field "created_datum" than this date field shows correctly for example "02-10-2008 15:15:17". But the site effect is that the content of filed "achternaam" (familyname) is corrupted.
For example before update 'abcdefghi'
after update '¿@ghi'

Strange enough is when I just update another date field for example 'error_datum' than "achternaam" is ok.

org.hibernate.Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
Query query1 = session.getNamedQuery("ounl.studieaanbod.bo.gmailAdressen.byStatus");
query1.setString("st", STATUS_REQUEST);
List<GmailAdressen> list = query1.list();
for (GmailAdressen request :list) {
......
if(error!=null) {
request.setError_datum(new Date());
request.setStatus(STATUS_ERROR);
request.setErroromschrijving(setErrorMessage(request.getErroromschrijving(),error));
}
else {
request.setCreated_datum(new Date());
request.setStatus(STATUS_ACTIVE);
}
}
}
tx.commit();
session.close();
}



I already tried with java.util.date and java.sql.date.
Any suggestions what could be wrong?
Regards,
Anton


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

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.