<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
#email-body { min-width: 30em !important; }
#email-page { padding: 8px !important; }
#email-banner { padding: 8px 8px 0 8px !important; }
#email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
#email-fields { padding: 0 8px 8px 8px !important; }
#email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
<tr valign="top">
<td id="email-page" style="padding:16px !important;">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
<tr valign="top">
<td bgcolor="#3e4c4e" style="background-color:#3e4c4e;color:#ffffff;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="https://www.jboss.org/dms/hibernate/images/jira/jiraheader_hibernate.png" alt="" style="vertical-align:top;" /></td>
</tr><tr valign="top">
<td id="email-banner" style="padding:32px 32px 0 32px;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
<img id="email-avatar" src="https://hibernate.onjira.com/secure/useravatar?ownerId=brmeyer&avatarId=11140" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
<div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
<a class="user-hover" rel="brmeyer" id="email_brmeyer" href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=brmeyer" style="color:#6c797f;">Brett Meyer</a>
created <img src="https://hibernate.onjira.com/images/icons/bug.gif" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#6c797f;text-decoration:none;' href='https://hibernate.onjira.com/browse/HHH-7816'>HHH-7816</a>
</div>
<div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
<a style='color:#6c797f;text-decoration:none;' href='https://hibernate.onjira.com/browse/HHH-7816'><strong>DDL opertations will incorrectly commit current transaction on Oracle XA</strong></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td id="email-fields" style="padding:0 32px 32px 32px;">
<table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
<tr valign="top">
<td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Issue Type:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="https://hibernate.onjira.com/images/icons/bug.gif" height="16" width="16" border="0" align="absmiddle" alt="Bug"> Bug
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Affects Versions:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
4.1.3 </td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Assignee:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="brmeyer" id="email_brmeyer" href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=brmeyer" style="color:#6c797f;">Brett Meyer</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Attachments:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
TestCase.zip </td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Created:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
19/Nov/12 4:50 PM
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Description:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<p style='margin-top:0;margin-bottom:10px;'>The XA Oracle driver is not able to manage DDL operations which result in transactions commits in a JTA transaction.</p>
<p style='margin-top:0;margin-bottom:10px;'>From <a href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=alessandrolt2" class="user-hover" rel="alessandrolt2">Alessandro Lazarotti</a>'s email on jboss-support-hibernate:</p>
<blockquote>
<p style='margin-top:0;margin-bottom:10px;'><span class="error">[Customer]</span> is facing <a href="https://hibernate.onjira.com/browse/HHH-1361" title="creating temporary table for bulk delete will commit current transaction in managed environment such as J2EE"><del>HHH-1361</del></a>/JBPAPP6-1628.<br/>
This issue seems fixed by <a href="https://hibernate.onjira.com/browse/HHH-1361" title="creating temporary table for bulk delete will commit current transaction in managed environment such as J2EE"><del>HHH-1361</del></a>, making dropTemporaryTableAfterUse<br/>
return false to Oracle Dialect. However testing the scenario with<br/>
hibernate-core-4.1.3 we still can see exceptions like:</p>
<p style='margin-top:0;margin-bottom:10px;'> insert<br/>
into<br/>
HT_IAP_PVR_L_RECORDINGS<br/>
select<br/>
lpvrrecord0_.RECORDING_ID as RECORDING_ID<br/>
from<br/>
IAP_PVR_L_RECORDINGS lpvrrecord0_<br/>
where<br/>
lpvrrecord0_.EQUIPMENT_ID='equip'<br/>
Hibernate:<br/>
delete<br/>
from<br/>
HT_IAP_PVR_L_RECORDINGS<br/>
javax.persistence.PersistenceException:<br/>
org.hibernate.exception.SQLGrammarException: ORA-00942: table or view<br/>
does not exist<br/>
at<br/>
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1372)</p>
<p style='margin-top:0;margin-bottom:10px;'>Sounds like Hibernate is still trying to delete the HT and commit the<br/>
DDL in that session (which is not allowed by Oracle Driver), even though<br/>
the dialect says to not do that. I've also tried a custom dialect,<br/>
flagging performTemporaryTableDDLInIsolation as true and as false but<br/>
without success.</p>
<p style='margin-top:0;margin-bottom:10px;'>A workaround which works is changing the application to a non-xa<br/>
datasource, which is not acceptable to customer, they must use XA (the<br/>
issue only happen when used XA).<br/>
Another solution is pre-creating the temporary table (since temporary<br/>
tables are like regular tables to Oracle). I've tested here and it<br/>
works, but customer said that it is not practicable and safe to<br/>
production environment.</p>
<p style='margin-top:0;margin-bottom:10px;'>So, they are expecting a patch. Attached here there is a test case which<br/>
reproduces the issue. It is a Eclipse project with dependencies already<br/>
bundled. Running the jUNIT it will setup a XA datasource using Bitronix<br/>
and run the test. The unique change should be made in the class<br/>
"OracleXaDatasourceHelper" to define an appropriated Oracle<br/>
user/password and URL.</p>
<p style='margin-top:0;margin-bottom:10px;'>Please let me know if there is something wrong in the test case that<br/>
justify the issue. Also, if you see another workaround that can be<br/>
applied instead of a patch will be welcome too.</p></blockquote>
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Project:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a style="color:#6c797f;" href="https://hibernate.onjira.com/browse/HHH">Hibernate ORM</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Priority:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="https://hibernate.onjira.com/images/icons/priority_major.gif" height="16" width="16" border="0" align="absmiddle" alt="Major"> Major
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Reporter:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="brmeyer" id="email_brmeyer" href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=brmeyer" style="color:#6c797f;">Brett Meyer</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td><!-- End #email-page -->
</tr>
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
This message is automatically generated by JIRA.<br />
If you think it was sent incorrectly, please contact your JIRA administrators<br />
For more information on JIRA, see: <a style='color:#6c797f;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
</td>
</tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->