Skip to content

Prepare statement for Hibernate fail without fast_forward=true #991

Open
@m-radzikowski

Description

@m-radzikowski

We have launched ProxySQL 1.3.5-0-g10bf524 to distribute traffic from several applications. One of them uses Hibernate ORM and, like most of the ORMs, uses prepared statements. On default ProxySQL config, with user created by:

insert into mysql_users (username, password, default_hostgroup, transaction_persistent) values ('tester', 'tester', 1, 1);

we got an error from Hibernate:

ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-103) No data supplied for parameters in prepared statement

I found issue #701, still open, in which it's said that should be supported from 1.3.0. Apparently they are not, or there is need for additional config.

I also found this topic: https://groups.google.com/forum/#!msg/proxysql/CQgZk82UYbs/SBhueqOQBQAJ in which there was a recommendation to set fast_forward=1 for this user. I tried this and in result queries are properly executed, but all statements go to master database, even simple selects.

My questions are:

  • Are prepared statements supported in v1.3.5? If so, what is proper config to use them?
  • Can user that uses prepared statements be routed to slave databases?
  • What details can I provide you to further investigate this problem?

Executing all selects on master is unacceptable in our case, as this app makes much more reads than writes. Using ORM is also necessary. Just FYI, we had no such problems with MariaDB MaxScale.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions