| Summary: |
EntityManager.find(java.lang.Class, Object,LockModeType) does not throw TransactionRequiredException when there is no transaction and a lock mode other than NONE is specified |
| Product: |
z_Archived
|
Reporter: |
Stephen DiMilla <stephen.dimilla> |
| Component: |
Eclipselink | Assignee: |
Nobody - feel free to take it <nobody> |
| Status: |
CLOSED
FIXED
|
QA Contact: |
|
| Severity: |
blocker
|
|
|
| Priority: |
P3
|
CC: |
lance.andersen, stephen.dimilla, tom.ware
|
| Version: |
unspecified | |
|
| Target Milestone: |
--- | |
|
| Hardware: |
Macintosh | |
|
| OS: |
Mac OS X - Carbon (unsup.) | |
|
| Whiteboard: |
|
| Attachments: |
|
Build Identifier: eclipselink-2.3.0.v20110604-r9504 Using the entity: @Entity @Table(name="CUSTOMER_TABLE") public class Customer implements java.io.Serializable { // Instance variables private String id; private String name; public Customer() { } public Customer (String id, String name) { this.id = id; this.name = name; } @Id @Column(name="ID") public String getId() { return id; } public void setId(String v) { this.id = v; } @Column(name="NAME") public String getName() { return name; } public void setName(String v) { this.name = v; } } ---------------------- Using the client code: try { em.find(Order.class, 1, LockModeType.PESSIMISTIC_READ); System.out.println("TransactionRequiredException not thrown"); } catch (TransactionRequiredException tre) { System.out.println("TransactionRequiredException Caught as Expected."); } catch (Exception e) { System.out.println("Unexpected exception occurred"); e.printStackTrace(); } --------- output: TransactionRequiredException not thrown Reproducible: Always