Jump to content

connection is already closed


cor

Recommended Posts

Making a preview of a reports for the seconde time with a connection to a sybase database,  i get the
following message after upgrading to Ireports 3.6.0  "connection is already closed"
Workaround is to  dis- and reconnect.

Sybase driver  jconn3 06-29-2009

Someone familiar with this problem ?

 

 

 



Post Edited by cor at 10/26/2009 14:53
Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

I had the same problem using first the provided and then a different version of the mysql driver in a 3.6.0 version of ireport downloaded last week, on ubuntu jaunty jackalope.  Yesterday I installed 3.6.1 and the problem went away.

However, "show grid" and "snap to grid" still do not work.

Also, I'm new to ireport and I couldn't see a way to connect my existing reports to a database connection short of using the wizard to create a new report -- but I suspect that was because I had not used the drop down in the toolbar, but had only started the connection via the services frame.  I don't know what would make this more intuitive, and I see the reasoning, but it did confuse me for a while. 

it occurs to me the "connection is already closed" problem might be related to the order in which the capabilities are switched on between the drop down and the services pane, which is why I mention it.  A coworker here did not experience the problem, working in a similar OS.

Alex

Link to comment
Share on other sites

  • 2 weeks later...

Is there a solution to this problem?  We're using 3.6.1

We have been chasing our own tails thinking it was an issue with our own JDBC driver but the exact same behaviour occurs using SQLiteJDBC i.e. previews once but never again.

From debugging our driver we can tell that iReports is making 2 connections, one during the main report design and another when it previews the report.  The latter is closed after the first preview - this is the problem because the next time it tries to preview, it uses the closed connection object.  One assumes that it should be re-connecting for each preview?

Any ideas?

Steve

btw - tried to run it in NetBeans to debug but as we're all Intellij fiends here we couldn't get off word go with NB complaining about some sort of configuration error....

 



Post Edited by sohara at 11/11/2009 18:13
Link to comment
Share on other sites

this is something I have to fix. How did you create the JDBC connections? I'm asking that because there are two ways to configre a JDBC connection in iReport: the first is by using the Runtime view and import a "NetBeans" JDBC connection as datasource, the second is by creating the JDBC connection directly in iReport.

Giulio

Link to comment
Share on other sites

Giulio...

This is how I set my Oracle connection.

1. Move ojdbc6.jar to /opt/iReport-nb-3.6.1/ide10/modules/ext

2. open window->services in iReport.

3. Add new database connection in services.

4. Click Report Datasources icon in tool bar.

5. Click new button.

6. Add netbeans datasource (Oracle from above) and set as default.

 

This reacts the same way on 3.6.0 as well.  ojdbc14.jar reacts the same way.

This on Ubuntu 9.04. I had the same issue on WinXP Pro.

 

Bob

 

Link to comment
Share on other sites

Hi Guilo

I set it up in the same way as Bob,

a) Services | New Connection | New Driver

b) Datasource | New | Netbeans Database JDBC Connection

BTW - how do you create a connection directly in iReports?  I assume you mean "Database JDBC Connection", but I've never figured out how to get my custom JDBC driver to appear in the list of drivers.

Steve

 

Link to comment
Share on other sites

Steve, just add the jar to the ireport classpath (Tools->Options->IReport->Classpath).

My guess was exactely that you were using the NetBenas connection which probably use some kind of connection pool, so iReport should not close the connection.

You can refer to this bug:

http://jasperforge.org/projects/ireport/tracker/view.php?id=4383

I'll schedule the fix for one of the next releases.

Giulio

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...