januszrut Posted May 20, 2013 Share Posted May 20, 2013 Hi, my problem is related to Jasperserver 5.1.0 from WAR file installation + Postgresql 9.1 +Tomcat 7 on Ubuntu 12.04 LTEI have a report that uses a plpgsql function. This function uses temporary tables. It runs properly in iReport but fails when connected to jasperserver report on Tomcat.The error message is: org.postgresql.util.PSQLException: ERROR: cannot execute DROP TABLE in a read-only transaction I knew this problem: in Jasperserver 4.7 + Postgresql 8.3 I successfuly used a workaround for it: I'd place 'set transaction read write;' at the beginning of the function. but now when I place this statement in a function, another error comes out: org.postgresql.util.PSQLException: ERROR: transaction read-write mode must be set before any query Gdzie: SQL statement "set transaction read write" Ghrrrr ... ;) And again: no problem when the function is called from cmdline, it fails just in jasper report.btw. 'defaultReadOnly=false' statements in context.xml and/or in postgresql connection string don't workKind regards Janusz Link to comment Share on other sites More sharing options...
januszrut Posted May 22, 2013 Author Share Posted May 22, 2013 ----- PROBLEM SOLVED ----- Hi,I got it! I misunderstood the concept of connecting via JDBC directly vs connecting by JNDI!I created a JNDI connection dedicated for the database (I'd previously connected by JDBC) in context.xml and the problem is solved!look here: http://community.jaspersoft.com/questions/525672/postgresql-jasper-reporting-server-error Link to comment Share on other sites More sharing options...
rosie.oneill Posted May 14, 2015 Share Posted May 14, 2015 Another option is to set the JDBC flag to false. In your datasource, add this to the JDBC url:?defaultReadOnly=falseWith version 6, you can use attributes to get dynamic datasource URLs, which we use, so JNDI was not an option.There is also an article here with a server level configuraiton approach (I haven't tried it)http://community.jaspersoft.com/wiki/how-remove-readonly-flag-jdbc-and-jndi-data-sources-jasperreports-server Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now