Error
Error Code:
4091
MySQL Error 4091: XA Temporary Table Access Denied
Description
This error occurs when a MySQL client attempts to access or modify temporary tables within an XA distributed transaction. It specifically triggers when the `xa_detach_on_prepare` system variable is set to `ON`, enforcing a restriction to prevent potential data inconsistencies in complex distributed transaction scenarios.
Error Message
XA: Temporary tables cannot be accessed inside XA transactions when xa_detach_on_prepare=ON
Known Causes
3 known causesxa_detach_on_prepare is ON
The MySQL server's `xa_detach_on_prepare` system variable is enabled, which explicitly restricts temporary table usage during XA transactions to maintain data integrity.
Temporary Table Usage in XA
Your application or SQL script attempts to create, read from, or write to temporary tables while an XA distributed transaction is actively in progress.
Conflicting Transaction Design
The architecture of your distributed transaction implicitly includes operations on temporary tables that are incompatible with MySQL's XA rules under the current configuration.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service