[ 
http://jira.jboss.com/jira/browse/JBAS-1269?page=comments#action_12314532 ]
     
Scott M Stark commented on JBAS-1269:
-------------------------------------

Give me a list of every context in which an ejb toString method may be called 
and I think that attempting this will make it clear why this is not practical. 
Unless the spec dictates where toString cannot be called, its fair game in any 
context and usage of methods which have clearly excluded context should either 
not be used, or guarded against.

> toString called on EJB
> ----------------------
>
>          Key: JBAS-1269
>          URL: http://jira.jboss.com/jira/browse/JBAS-1269
>      Project: JBoss Application Server
>         Type: Bug
>   Components: EJBs
>     Versions: JBossAS-4.0.1 Final
>  Environment: Linux, J2SE 1.4.2_06
>     Reporter: Michael Lipp
>     Assignee: Scott M Stark
>     Priority: Critical

>
>
> org.jboss.resource.connectionmanager.CachedConnectionManager calls toString() 
> on EJBs (e.g. line 250, where "rawKey" is an EJB.
> The "toString()" method of an EJB may, however, be overwritten, as is 
> appropriate for the type of EJB. Such a toString() method may use 
> getPrimaryKey() as it will usually be called from the business methods, i.e. 
> from a context where this call is legal.
> CachedConnectionManager calls toString() during create, i.e. in a context 
> where the call to getPrimaryKey is illegal, which results in an 
> IllegalStateException. In order to avoid this kind of problem, the 
> application server should never call toString() on EJBs.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to