Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] mySQL/Oracle behavior differences

I am not aware of an issue that would cause this kind of difference between Oracle and MySQL.

My first suggestion is to try a more recent release. (2.1.2 is quite old. Our latest is 2.3.2)

If that doesn't help, try having a look at the SQL. If you set the persistence unit property eclipselink.logging.level=FINER, you should see the SQL. Does the SQL produced look correct?

If neither of these things help, please provide some more details including how your objects are mapped, the code you are running to see the problem, the SQL Strings from both DBs and a detailed description of what you get back.

-Tom

On 01/03/2012 11:38 AM, Alay, Aysun wrote:
Hi all,

We have a map<String,String>  attribute which is mapped with ElementCollection mapping inside an embedded object. It is eagerly fetched and it uses BatchFetch.JOIN .

In Mysql deployment, there is no problem persisting/retrieving this attribute. However, in Oracle deployment we are having problem on retrieving the values of the attribute which is mapped with ElementCollection. If there is more than one record retrieved from the main entity, all the elemenCollection mapped attributes are empty even though we have values for them in the database.

If the query is returning one specific entity ( where id=<value>, then we can get the record with populated ElementCollection mapped attributes. But, if I retrieve all the entities in the table, I don't see anything set to the ElementCollection mapped attributes. They are all empty.

Is there anybody experience the same issue, or any behavior differences between MySql and Oracle deployment in eclipseLink? We are using EclipseLink 2.1.2 with Weblogic 10.4.

Thanks
Aysun


Here is how our Entity looks like

@Entity
public class AlarmEntity {
   @Id
   @Column(name="ID")
   private long id;
   ...
   @Embedded
   private CommonAlarm commonAlarm;
   ...
}

@Embeddable
Public class CommonAlarm implements Serializable {
...

@Embedded
Private AdditionalAttr addAttr = new AdditionalAttr();
.
.
}

@Embeddable
Public class AdditionalAttr extends BaseAttr implements Serializable {

@ElementCollection(fetch=FetchType.EAGER)
@BatchFetch(BatchFetchType.JOIN)
@CollectionTable(name="ADDITIONAL_ATTR", joinColumns = @JoinColumn(name= "ALARM_ID"))
@MapKeyColumn( name = "ATTRNAME")
@Column(name= "VALUE")
private final Map<String String>  anvp = new HashMap<String String>
.
.
}

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top