-->
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.  [ 2 posts ] 
Author Message
 Post subject: URGENT Hibernate and EHCache
PostPosted: Fri Apr 08, 2005 10:32 am 
Newbie

Joined: Tue Feb 01, 2005 8:18 am
Posts: 8
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1.6

I am having one table

CREATE TABLE tableA (
table_id varchar(10) NOT NULL default '',
....
PRIMARY KEY (table_id)
);

So here , primary key is on table_id which is of type varchar .

I have mapped this table as shown below :

<class name="A" table="tableA">
<cache usage="read-write"/>

<id name="tableId" column="table_id" unsaved-value="">
<generator class="assigned"/>
</id>
..................
</class>

table_id is case insentitive .

I am using ehche 0.9

My problem is when I specify tableId as "ABC" and as "abc" while fetching it from database , two
entries are being made in the ehcache one for "ABC" and other for "abc" due to that I do not get proper record while
fetching it from the database.
I think the problem is that key for the cache is case sensitive . So it is treating "ABC" and "abc" as differently .
Please help me .
Tx in advance .



Name and version of the database you are using: MySQL 4.0.22


Top
 Profile  
 
 Post subject: Assignment of ID
PostPosted: Fri Apr 08, 2005 1:51 pm 
Newbie

Joined: Thu Apr 07, 2005 1:57 pm
Posts: 2
Location: Brisbane, Ca, USA
Maybe you should try change the setter of table id as follows

public void setTableID( String ID ){
this._ID = (ID != null )? ID.toLowerCase() : ID;
}

Doing this will make it impossible for your IDs to have different cases and thus EH Cache won't have the same trouble.

Good Luck!


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