Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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].
 
machines help you to do more, but experience less. Experience this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic