• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I cache the global data in weblogic

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want cache some data in the container, cache is read/write,how can I do it ?
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Improve J2EE Application Performance with Caching
 
chao cai
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wanna make a cache(read/write) in memory used by the EJBs.
How can I do this ,can use the singleton or startup class.
Once I have used the startup class to bind a hashmap to JNDI, but I found I just can read the value, can not modify the value in the EJB.
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please elaborate it ? What do you mean by you could not modify the value in EJB. What kind of exceptions did you get.

Thanks

Lin
 
chao cai
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In EJB, how can I access a global cache to read and write data, the cache can access by different ejb instances
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by chao cai:

Once I have used the startup class to bind a hashmap to JNDI, but I found I just can read the value, can not modify the value in the EJB.



This sounds like you haven't tied your beans to your cache. Are they entity beans direcly tied to a DB?
Caching dynamic data doesn't make sense. You will be introducing extra overhead by monitoring the data and propogating changes. Unless you have benchmarks showing that repetitively fetching data is a bottleneck, I'd be inclined to avoid caching.
 
Lin Feng
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In EJB, how can I access a global cache to read and write data, the cache can access by different ejb instances



Sorry that I have not got your question. You have already metioned some possible solutions. It sounds like that you have some troubles when you tested them. In theory they should work. Could you please post some detail information about the errors you got for the startup class binding a hashmap to the JNDI? Then I will have a better understanding on the context. By the way you may also use a stateless session bean to do it.

Thanks

Lin
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic