Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cache problem with whitespace in key

 
al Dupin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody.

I've problem with websphere EJB cache .

Imagine a table with a key that is Char(5).
first time looking the record key 'toto',
entity with key 'toto ' will be retrieve.

If i'm looking for the second time, (findByPrimary('toto')) , another instance of entity will be load.

If findByPrimary('toto ') , it's ok, it is taken from the ejb cache.

Is it a database problem -> retrive 'toto ' and not 'toto' or i must develop my entity for fit that case ?
[ July 10, 2006: Message edited by: al Dupin ]
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The blank padding is done by the database. The best option is to change the data type to varchar or any other suitable variable length character data type available for the particular database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!