What about using Comsat? They claim using Fibers i...
# exposed
j
What about using Comsat? They claim using Fibers is much more lightweight than regular threads which allows you to write blocking code and get very close the same benefits as true async. http://docs.paralleluniverse.co/comsat/#db-access
Copy code
JDBC
The comsat-jdbc project makes the JDBC API more efficient when using Quasar fibers (or fiber-backed actors). To use JDBC in fibers, simply wrap your database driver’s DataSource with FiberDataSource, and use it to obtain connections. For example:
It also appears that if you’re going to use fibers, it’s all or nothing, once you start using fibers to improve JDBC, you can’t use that data-source with any other ORM-like framework
Copy code
Note: Your application may only make direct use of the Comsat JDBC data source, because methods calling the API must be declared suspendable (or run on regular threads). Database access frameworks (like various ORM solutions) that make use of JDBC cannot use this data source and be used in Quasar fibers. In the future, we will provide separate integration module for some popular database access libraries.