Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting PostgreSQL Exception while trying to execute query in ScriptRunner

raja_sooriya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 13, 2021

I am using Confluence Data Center Version. I am trying to execute a query in ScriptRunner by using Create Resource->Local database connection->Preview. While executing the query i am getting the below error:

Error: Cannot change transaction read-only property in the middle of a transaction.

ScriptRunner Version: 6.15.0
Database used in PostgreSQL. 

Please find the screenshot for the same. 

Error SC.PNG

2 answers

2 accepted

2 votes
Answer accepted
Aleksa Novevski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2021

Hi @raja_sooriya ,

After I had been struggled for some time with this same error, I decided not to make pool for Local Database Connection, but to try to make another resource as Database Connection where I included parameters of my local database. Might not be the best solution but it worked for me.

Regards

raja_sooriya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2021

@Aleksa Novevski  Thanks for the solution. But sometimes it may happen that we can't get DB details from the client due to compliance policy.

Like Aleksa Novevski likes this
1 vote
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
May 13, 2021

Hi @raja_sooriya,

Are you using the latest ScriptRunner version for Confluence? If not, could you please update your ScriptRunner to the latest release, and retest the query again?


Thank you and Kind Regards,

Ram

Aleksa Novevski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 25, 2021

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

Can you possibly think of any other solutions to the problem? I was using latest release and was facing the same problem. With some older versions of Scriptrunner I was able to see preview but I am getting error rendering macro. With the latest one I get both error whilst trying to test connection pool and the rendering error. 

image.png

As you can see it is the same error. As soon as I exclude lines that requesting data from the database pool, macro is rendering with no errors. 

Thank you in advance,


Aleksa

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events