Hi,

I came across this issue while running some test cases on Groovy 2.4.5.

The following code works as expected. If the stored procedure call takes longer 
than 5 seconds an SQLException will be thrown indicating that the query timed 
out:

        sql.withStatement { stmt ->
            stmt.queryTimeout = 5
        }

        sql.call("{call Add_User($user.email, $user.password, ${Sql.BIGINT})}")

However, if I pass a closure to the stored procedure call to retrieve the 
returned values the configureStatement never gets executed and therefore the 
query timeout value is ignored:

        sql.withStatement { stmt ->
            stmt.queryTimeout = 5
        }

        sql.call("{call Add_User($user.email, $user.password, ${Sql.BIGINT})}”) 
{ ID ->
            println “Auto generated User ID: $ID"
        }

Is this is a bug in Groovy? or am I doing something wrong?

Regards,
Guillermo Roman

Reply via email to