File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMP db Access

 
Bernhard Neuhauser
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,

Is it possible to access more then one DB via CMP inside the same EJB container?

Maybe another issue:
Is it possible to cache some Entities readonly for failsavety reasons?

Currently i search for a possibility to hold some tables as local cache being accessible for all Cliens. When the db disapears, this might give me the possibility to server clients till the db failover is completed.

I know that several ejb calls will fail, because they need write access. But i also know that my app might be able to serve some client types without the db.

So for example a small outdated h2 in-memory db will be already enough for my purpose. But i dont know if its possible to share this db with all connected clients.

thx for feedback
Bernhard Neuhauser
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your CMP *layer* can use multiple databases, but any one CMP *bean* can only use a single database. Having read-only beans could possibly protect you from short outages if the *only* usages during that time period are read-only (i.e. no change events progated from a read/write version of the same bean), but only until you hit whatever refresh event your read-only beans have been configured to implement. If you need transparent failover, you might want to look into databases that provide transparent failover with a JDBC driver supporting that feature (e.g. Oracle RAC).
[ February 15, 2006: Message edited by: Reid M. Pinchback ]
 
Bernhard Neuhauser
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx ) exactly what i wanted to know

The db behind is already clustered. Still, there might be some "circumstances" where the db will be unavailable for some minutes. The own appserver will still try to serve some clients.

The fallback cmps are readonly in this case. Okay there will be updates from another app, but i think im able to trigger the refresh event when an update occours.

thx
Bernhard
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic