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

Best place to Log in an Entity Bean  RSS feed

 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have got a couple of Entity Beans here and I would like to Log a particular event only : when data are going to be written in Database (Insert or Update).

My problem is that I cannot find the right place in my EJBBean to code my Log4J debug call to get the Log without duplicate traces.

For exemple :
- if I choose the ejbCreate() method, I'll get all Insert events. It's great but I wont have Update events...

- if I choose the ejbStore() method, I'll get all Insert, Update events ... but findByPrimaryKey as well

Any idea ?

Thanx
[ June 04, 2004: Message edited by: Franck Tranchant ]
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

does your architecture uses facade session beans, if it dos so I belive you could do the log from there as you problably have methods insertXXXX, updateXXX where you may do your log, and as far as you use a safe transaction demarcation you won't have problems about wrong logs.

 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hum, you're perfectly right Marcos but I thought that logging as close to the Bean as possible would be better...

And to be honest, it's also for curiosity reason I asked the question ;-)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!