-->
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.  [ 3 posts ] 
Author Message
 Post subject: Duplicate row with MDB
PostPosted: Wed Jul 12, 2006 7:00 am 
Newbie

Joined: Wed Jul 12, 2006 6:36 am
Posts: 5
Hibernate version:2.1.7
Name and version of the database you are using:Oracle 9i

Simplify...
I must load an object DAY when it does not exist or I must create it if it does not exist previously.
This happens to the arrival of a message on a MDB.
I use BEA and the relative DataSource.
The problem is that on the contemporary arrival of the messages they create more table-row for the same day and this does not have to happen.
How I resolve the synchronization problem?
Someone have advised to me to insert UNIQUE constraint on the DB and to manage the exception of the duplication of such field.

What is the correct way to proceed?

Help me, please!

This is the sample code...


day = getDay(day, session);
if (day == null) {
Transaction tx = null;
try {
day = new Day(Calendar.getInstance);
day.setCreatorUser("system");
day.setStatus(DayStatus.SOURCE_UNAVAILABLE);

tx = ss.beginTransaction();
session.save(dayW);
tx.commit();
}
catch (Exception e) { ... }


Top
 Profile  
 
 Post subject: Therefore, you do not have no idea?
PostPosted: Fri Jul 14, 2006 9:22 am 
Newbie

Joined: Wed Jul 12, 2006 6:36 am
Posts: 5
Therefore, you do not have no idea?


Top
 Profile  
 
 Post subject: Therefore, you do not have any idea?
PostPosted: Fri Jul 14, 2006 9:23 am 
Newbie

Joined: Wed Jul 12, 2006 6:36 am
Posts: 5
Therefore, you do not have any idea?


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