Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] AspectJ for auditing / JNDI problems

Hello all,
   in my ear application,we need to be able to track changes done to certain
databse tables (so, changes done to some EJBs)
So we need to create an audit component which intercepts certain methods of
EJBs being audited. this component should create a log of the audit data and
store it in the database.
At the beginninng, when i was investigating issue, i decided to use aspectj
rather than add methods to all ejbs that needed to be audited.
It seemed a good idea, until i faced a problemt that i cannot solve.
The audit component, in order to store the audited data in the database,
needs to have a ccess to an EJB (we prefer, as of now, not to move to
solution lik ehibernate since we don't want to use differetn technologies
for persisitng data).
AS i found out, i cannot do a JNDI lookup to the EJB that needs to store
audited data in the databse:
- i CAN'T use the EJB JNDI name, since Websphere resolves every JNDI name to 
something like  host:server:cell:JNDI, and i don' twant to bind my code to
server or hosts
- i CANT use ejb-ref (such as java:/comp/env/ejb/MyEJB) if the EJB being
intercepted does not have my AuditEJB as a referenced EJB in ejb-jar.xml

to me, it looks like it is 'not so nice'  to enable auditing for certain
EJBs by just putting as an ejb-ref the JNDI Name of AuditEJB, since it is
never used in the code and it might look confusing to someone who review the
code and does not understand/know aspectJ.

Can anyone suggest me a solution to this problem? it looks like referencing
the EJB via JNDI is not the proper solution.. but i don' tknow how to get
hold of my AuditEJB for other means than JNDI...

thanks in advance and regards
  marco


--
View this message in context: http://www.nabble.com/AspectJ-for-auditing-JNDI-problems-t1307456.html#a3483521
Sent from the AspectJ - dev forum at Nabble.com.



Back to the top