• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP and external DB updates

 
Marina Popova
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I'm facing an interesting problem now.
I'm using CMP for my entity beans and I've noticed one thing: if I do an external update to the tables that the beans are mapped to, those updates are not seen by my beans. If, for example, I delete some rows and then try to look up the corresponding entity beans through, say, findByPrimaryKey - the find method succeds though there are no data in the table... Needless to say that whatever I do with the returned "found" bean fails.
Is this a problem with the container (I'm using WLS5.1 + SP9) caching entity beans? It seams as though WLS doesn't call the ejbLoad() methods before findByPrimaryKey() (and others) methods...
I did set up all related properties for the beans, like:
db-is-shared = true
there is no is-modified-method
cache-strategy = read-write
Am I missing something here?
thanks a lot,
Marina
 
James Hobson
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not really a "problem" with caching, it is exactly expected behaviour. You can turn caching off, but then you will most likely take a significant performance hit.
Depending on how/why you are modifying the data "externally" you could look at writting a console app that connects to the app-server and does the updates though the EJB layer, or if you have time/money/skills++ you could put a CORBA wrapper on your app and integrate your external modification tools...........
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!