puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

Jdbc FiberConnection doesn't use Fibers where appropriate #27

Closed hsestupin closed 9 years ago

hsestupin commented 9 years ago

Hi, may be I'm misunderstood something. Is there any reason behind that fibers aren't used in every FiberConnection method which throws SQLException exception. For example java.sql.Connection#commit is a blocking method undoubtedly. Why don't we have to wrap it to something like this:

FiberAsync.runBlocking(exec, new CheckedCallable<Void, SQLException>() {

    @Override
    public Void call() throws SQLException {
        return conn.commit();
    }
});
circlespainter commented 9 years ago

Thanks for reporting this, I'll look into it very soon. Yes, they should really be fiber-blocking.

circlespainter commented 9 years ago

Fixed with this branch that will be merged into master to enter next release.