Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357533 - Allow DDL queries to execute even when Multitenant entities are part of the PU
Summary: Allow DDL queries to execute even when Multitenant entities are part of the PU
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 14:04 EDT by Guy Pelletier CLA
Modified: 2022-06-09 10:22 EDT (History)
2 users (show)

See Also:


Attachments
Proposed changes (2.3.1 stream) (39.45 KB, patch)
2011-09-13 15:19 EDT, Guy Pelletier CLA
no flags Details | Diff
Updated patch for 2.3.1 stream (39.77 KB, patch)
2011-09-14 10:15 EDT, Guy Pelletier CLA
no flags Details | Diff
Patch for trunk (40.27 KB, patch)
2011-09-14 10:49 EDT, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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