I had problems to use Hibernate(JPA) to work with Firebird a while ago. Every connection opened was not being closed, I couldn’t ever think to use a pool of connection in my web service and the temporary tables was being created next to other tables. In this post, I will focus on the problem with temporary tables.
Hibernate creates temporary tables in other databases too but there is a specifically problem with Firebird. After sometime (after a lot of websites), I figured out that the Hibernate dialect for Firebird doesn’t know about global temporary tables, so it creates them as normal tables instead.
So, the solution for this problem is implement a class that will deal with the Dialect and in this class take control the creation of the temporary tables.
In the persistence.xml add this attribute that references our new class: