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

two processes in one ejb  RSS feed

 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. If somebody has a minute, I was wondering if it was possible, in a single CMP ejb, to query one table (in order to aquire a sequential tracking number) and then insert a record (with the derived tracking number from the above finder and other passed values) into another table. In the deployment descriptor, I have the first table indicated as an abstract schema for the custom finder method. However, I want the insertion to occur in another table...but I'm not sure where/how to indicate that. Does this require a different entity all together to achieve this?

I orignally planned to use cmp soley to manage the transactions on aquiring the control number...then running an insert at the user's discretion...but various workflow factors led me to try the insert when the new tracking number is assigned. It just feels weird to do jdbc for the insert within the session facade when i think i could leverage the cmp to do the insert as the tracking number is assigned...but again, the insert is into a different table.

I guess it comes down to this...if I indicate a second abstract schema name within a single entity tag in the deployment descriptor (if that is even possible), how could the createEJB method figure out which one to insert...

Thank you very much for reading my question...even if it's indecipherable.
[ April 04, 2005: Message edited by: Tom Griffith ]
 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do that within a single CMP. Use two CMP for the two tables and a session method to enwrap the tranaction, it will rollback if something bad happens
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this in a session bean +[optionally with two entity beans].
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!