Gill Bates
Gill Bates

Reputation: 15167

Is it possible to use ORM together with Vert.x?

As I understand there is an async JDBC driver that is Vert.x compatible: https://vertx.io/docs/vertx-jdbc-client/java/

But at the same time I haven't found any information about usage of Java ORMs together with Vert.x.

Can someone shed some light on that?

Upvotes: 2

Views: 2452

Answers (3)

roma2341
roma2341

Reputation: 124

You should not use a framework focused on fast query processing and an ORM that annihilates performance (and often makes deadlocks and other issues that are hard to be fixed)

Upvotes: 0

morpheus
morpheus

Reputation: 20350

Check out Hibernate Reactive

Hibernate Reactive is a reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.

Out of the box, the Vert.x clients for PostgreSQL, MySQL, and DB2 are supported, though the architecture is not limited to these drivers.

Upvotes: 2

tsegismont
tsegismont

Reputation: 9128

I am not aware of any full-featured Java ORM that has non blocking APIs.

This is why if you want to use an ORM in a Vert.x application, you should use executeBlocking to wrap the ORM calls or put your persistence code in a worker verticle.

There's an example for this scenario in the vertx-examples repository.

Alternatively, you could a tool like JOOQ, an active community member has developed a neat integration.

Upvotes: 0

Related Questions