Re: Cayenne callback listener in single transaction

Artem Kravchenko <[email protected]>
Newsgroups gmane.comp.java.cayenne.devel
Message-ID <[email protected]>
Hello Andrus
Thanks for your replay.

Not sure how it works butfor example:
I need to insert some Entity and on @PostPersist get the PK of this record.
So the question is:

will 'insertBefore' collect all changes (main commit and callback) first 
and then apply bulk SQL (inserts/updates)

or

1. open transaction
2. perform main sql INSERT (db assign PK for new record)
3. perform callback operation (newly generated PK is accessible )
4. close transaction

In fact I am interested in second scenario
first one doesn't fit for us
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.