• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

two processes in one ejb

 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do this in a session bean +[optionally with two entity beans].
 
reply
    Bookmark Topic Watch Topic
  • New Topic