db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: using set role in a stored procedure / Error 25001
Date Thu, 22 Jul 2010 08:39:19 GMT
Thomas <Thomas.K.Hill@t-online.de> writes:

> Hi,
>
> can someone please advise if it is possible to execute a 'set role' command
> within a stored procedure? My code runs fine when being part of the java
> program, but throws "ERROR 25001: Invalid transaction state: active SQL
> transaction." when put inside a java stored procedure.

Hi Thomas,

It should be fine to execute SET ROLE as the first SQL operation inside
a stored procedure, but, as you've noticed, the transaction must be idle
when the procedure is called. This means that if there's been any
activity on the connection, you'll need to commit or rollback before you
call the stored procedure.

Hope this helps,

-- 
Knut Anders

Mime
View raw message