Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IO from an MDB  RSS feed

 
john smith
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a bunch of very good reasons why you should not us IO from an EJB. However, given that in my app security isn't an issue, can anyone give me a good reason why I shouldn't use IO from an MDB?
 
Jason Stull
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your app server vendor have a file system resource adaptor you can use or do you have instructions on how to build one yourself?
 
john smith
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can't be tied to any particular app server flavour - we have to support JBoss, Weblogic and Websphere. I was considering adding a resource adapter, but the work involved in that is what got me wondering if I could think of a reason not to just use IO asyncronously?
I need to drop files to a native consumer process running in the same place on every server in the cluster - so I don't care if there are different versions of the same file spread around the cluster (the native process should handle these anyway). I don't care about security - these files are being used to mail notifications using SMTP - which is insecure by design anyway. And I'm always going to be exporting to files, never reading in. Do you see any "gotchas" I've missed?
 
Jason Stull
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the mdb will be running on each node in the cluster and reading a local file? As long as you are just doing reads, I think you'll be ok. As far as concurrency, make sure your java.io package references are only declared at the method level. I've had to break the spec before, too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!