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

EJB specification (question)  RSS feed

 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reincarnation of my old question on Runtime.exec() from EJB.

I remember that here were few replies that according EJB specification, calling Runtime.exec() is prohibited.
Specification says:


An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.


Is calling Runtime.exec() concerned to be "accessing files"?

If so, why JBoss 3.2.6 and BEA WebLogic 8.1 SP2 doesn't follow official EJB specification and allows enterprise bean to do execute? I've tested that, and it's true.

I would be gladful if someone will clarify or help me to understand that more properly.

Thanks.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37230
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Olexiy,
I think Runtime.exec() would be something to not do from EJBs. The idea is not to do things where the state can't be rolled back. The app servers don't enforce everything you can't do. For example, you can write to a DebugLog (which requires) I/O despite the fact that this goes against the spec per se.
 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

I was interested if Application Servers prohibit doing everything what is prohibited in specification. I guess you are right, and they do not.

As for me - I am not doing Runtime.exec() from EJB myself, just was interested about above mentioned point.

Thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!