Bug 123685 - Need a way to detect/introspect current transaction
Summary: Need a way to detect/introspect current transaction
Status: RESOLVED WONTFIX
Alias: None
Product: EMF Services
Classification: Modeling
Component: Transaction (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical
Target Milestone: ---   Edit
Assignee: Chris McGee CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-01-12 17:17 EST by Christian Damus CLA
Modified: 2017-02-24 15:10 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-01-12 17:17:34 EST
Code that may be invoked in a transaction context needs to be able to detect that context and get some key properties (such as read-only-ness).

Currently, it is a programming error to attempt to start a read-write transaction in a read-only context, but code has no way to detect when it would violate that rule.
Comment 1 Chris McGee CLA 2006-02-21 17:34:35 EST
If one really needed to introspect then they could always do the following:

((TransactionalEditingDomainImpl)editingDomain).getActiveTransaction().isReadOnly()

No plan to fix this.