Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357533

Summary: Allow DDL queries to execute even when Multitenant entities are part of the PU
Product: z_Archived Reporter: Guy Pelletier <guy.pelletier>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, karenfbutzke
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed changes (2.3.1 stream)
none
Updated patch for 2.3.1 stream
none
Patch for trunk none

Description Guy Pelletier CLA 2011-09-13 14:04:20 EDT
Since we turn off native SQL queries once we discover at least one multitenant entity, DDL generation will fail (exception thrown) 

Caused by: Exception [EclipseLink-6175] (Eclipse Persistence Services - 2.4.0.v20110824-r9956): org.eclipse.persistence.exceptions.QueryException
Exception Description: Native SQL queries have been disabled. This is done either by setting the persistence unit property eclipselink.jdbc.allow-native-sql-queries to false or having at least one multitenant entity defined in your persistence unit. Check your persistence unit specification. To allow native sql queries, set this property to true. Alternatively, individual queries may bypass this setting by setting the eclipselink.jdbc.allow-native-sql-query query hint to true.
Query: DataModifyQuery(sql="DROP TABLE B") 

DDL generation queries should bypass the global setting and allow for native sql queries.
Comment 1 Guy Pelletier CLA 2011-09-13 15:19:26 EDT
Created attachment 203290 [details]
Proposed changes (2.3.1 stream)
Comment 2 Guy Pelletier CLA 2011-09-14 10:15:33 EDT
Created attachment 203339 [details]
Updated patch for 2.3.1 stream
Comment 3 Guy Pelletier CLA 2011-09-14 10:49:24 EDT
Created attachment 203342 [details]
Patch for trunk
Comment 4 Guy Pelletier CLA 2011-09-14 11:04:02 EDT
Changes have been submitted.

Verified by: Gordon Yorke

Tests: Opened up the DDL generation model which has multitenant entities and previously set the allow native SQL queries on the PU. With these changes, that flag is no longer needed in this case.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:22:28 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink