Jump to content
We've recently updated our Privacy Statement, available here ×

sergio_s21

Members
  • Posts

    15
  • Joined

  • Last visited

sergio_s21's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. lucianc Wrote: If the report fill thread is executing a query, JR relies on java.sql.Statement.cancel() to cancel the query. If the JDBC driver that you are using does not support this (and does not chec for Thread.isInterrupted()), then there's nothing that we can do to interrupt the thread. Hi lucianc, that was the problem. The JDBC driver that we are using does not implement the java.sql.Statement.cancel(), so we have to modify it to cancel the queries. Thank you for the help!
  2. Definitely, the threads are NOT cancelled. For more detail, the thread is stopped in a long database query. I've try to interrupt it, but the thread continues running. The Thread.interrupt() method seems to be ignored, maybe because the thread is blocked? The methods stop() and destroy() are deprecated, and I can't check periodically if the thread has been interrupted because it is stopped in the long query mentioned above. Do you know some solution to force to stop the thread?
  3. The complete code of fillAsynchronousReport is posted below. In AsynchronousFillHandle, I've only added one method to get the report result, like this: public JasperPrint getJasperPrint() { return print; } Thanks Code:public static JasperPrint fillAsynchronousReport(JasperReport jasperReport, Map parameters) throws JRException { final AsynchronousFillHandle handle = AsynchronousFillHandle.createHandle(jasperReport, parameters); JasperPrint print = null; try { parameters.put("HANDLE", handle);/*ADD HANDLE TO THE PARAMETERS*/ //Start the asynchronous thread to fill the report handle.startFill(); //Wait until the thread ends to get the result handle.fillThread.join(); if(!handle.cancelled){ print = handle.getJasperPrint(); } } catch(InterruptedException ie) { throw new JRException("The report filling thread was interrupted"); } catch(Exception e) { throw new JRException(e.getMessage()); } return print; }
  4. Hello another time, and sorry for being tedious, but its important to resolve this issue. I've been doing some progress, and I think I almost have the solution. Today's question is very simple, it would be fantastic if someone could give me some clue about it. I am using the method join() in the main thread to wait for the "report thread" to finish. When the report finish successfully, everything works fine, but when I cancel the report, the main thread doesn't continue with the execution. It seems like the "report thread" doesn't finish or something similar. The question is, are you sure if the thread finish completely when I interrupt it? Thanks in advance
  5. Hi again. I've synchronized the threads adding a new method in the JRFiller class. Also, I've added some methods in AsynchronousFillHandle class to get the JasperPrint object generated and to indicate if the job has been cancelled. Everything works fine, but after the report is cancelled, I have this exception: 13:04:05,796 ERROR AbstractFlushingEventListener,http-8180-Processor25:301 - Could not synchronize database state with session org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.jaspersoft.jasperserver.api.engine.scheduling.hibernate.PersistentReportJob#5020] This exception only occurs in runtime. In debug mode, step by step, I haven't got any error. Any idea? Thank you in advance. You can see the code of the JRFiller method below. Ask me for the AsynchronousFillHandle code if you need more info. Code: Post Edited by sergio_s21 at 06/09/2009 12:24
  6. Thank you for your response lucianc. I've implemented a test using AsynchronousFillHandle and now, the cancelIFill() method does work correctly. However, I have another problem. I'm using jasperreports from jasperserver web interface, so, as you can see in the code of the previos post, in fillReport method I need to return a JasperPrint object in order to print it after the execution has been completed. I can't modify the 'run' method of AsynchronousFillHandle to return a JasperPrint because its implementation not allow me to do this. I would like to wait until the fill report finish, and return the JasperPrint object generated, but I don't know exactly how to do this. Have I synchronize the threads? Or there is some posibility to modify the AsynchronousFillHandle to return the JasperPrint object generated? I hope you can understand my post. Some clue or advice would be fantastic! See you Post Edited by sergio_s21 at 06/08/2009 15:46
  7. Hi guys, and first of all, sorry for my english. I hope you can understand my post. I have a problem stopping report execution. I've seen some post that recomend to create a new filler for the report and call to cancelFill() later to interrupt it. I follow this steps (you can see the code below): - Create the filler and fill the report like this: - Call to cancelFill when the user push "Cancel Button" in Jasperserver and try to interrupt the thread: However, the thread does NOT interrupt. It seems to ignore the t.interrupt() instruction. ¿What I am doing wrong? Thanks in advance!! Code:public static JasperPrint fillReport(JasperReport jasperReport, Map parameters) throws JRException{ JRBaseFiller filler = createFiller(jasperReport); try { JasperPrint jasperPrint = filler.fill(parameters); return jasperPrint; } catch (JRFillInterruptedException e) { throw new JRException("The report filling thread was interrupted."); }}public void cancelFill() throws JRException{ if (log.isDebugEnabled()) { log.debug("Fill " + fillerId + ": cancelling"); } /***** CLOSE THE RESULT SET*******/ mainDataset.closeDatasource(); if (parentFiller != null) { parentFiller.unregisterSubfiller(this); } //fillingThread = null; //kill the subreport filler threads killSubfillerThreads(); /********************************/ if (fillContext.cancelRunningQuery()) { if (log.isDebugEnabled()) { log.debug("Fill " + fillerId + ": query cancelled"); } } else { Thread t = fillingThread; if (t != null) { if (log.isDebugEnabled()) { log.debug("Fill " + fillerId + ": Interrupting thread " + t); } t.interrupt(); } }} Post Edited by sergio_s21 at 06/05/2009 12:47
  8. Hi all, I have a report with a Date parameter value. I want to check wether the value is before to current date - 1 year. In this case I want to set the parameter value to current date - 1 year. In case the parameter value is after current date -1 year, the value is ok. Any suggestions? Thanks.
  9. I have the following problem. I run a report in background, it takes between 12 and 15 minutes in getting the results. That is right due to the amount of data. The same report, if it is running in 'online' mode, after 5 minutes of execution, throws an error. Are there any parameter in which you can indicate the time of connection allowed or something like that? Thanks.
  10. I'm also very interested in this topic. If anyone could help us, it would be very appreciated. Thanks in advance. Post Edited by Sergio S at 11/13/08 09:48
  11. No, I don't launch any report. I only use the WS and I have extended it. Every time I call a method of UserAuthorityService object from ManagementService, the session keeps open until the server is re-started. It has nothing to do with any report. Any idea? Thanks.
  12. Hi all, I have a problem with jasper and DB connections. I have implemented some methods to manage user and roles and add it to ManagementService.java class in order to access through Jasperserver WebService. When I am using my app, and it calls to my new implemented methods, it seems to work fine, buy really, Jasper doesn't close DB connections. Finally, the number of connections exceeds the PostgresSQL limit (it's established to 100) and I get an exception like this: java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections" I don't know what to do to solve this. Any idea? Thanks in advance, Sergio
  13. Hi Mr. Wood. You said: "You can see the list of unfinished report schedules for a report through the UI." Sorry, I am not able to find that list through the UI. Anyway, I would like to write a log in the exact moment in wich a scheduling report is running, but I don't find the class that finally does this task. And much better (if it was possible) to write another one just after finishing that execution. Thanks in advance.
  14. Hi all, I have some reports in the repository that its execution could take some minutes or even some hours. This is right due to the amount of data that is seeked. This reports are switched on scheduled. For that reason I would like to show a list in which users can see the reports that are currently executing. Has anybody got any idea about this? Thanks in advance.
  15. Hi all, Does anybody know wether there is a way to show the state of the process of a query (or a report) in execution? I mean, I have some reports which make very big data volume queries, that in some cases could take a few hours. So I want to show to the user the state of the report process like a status-bar does, or even with numbers of somthing similar. Thank you.
×
×
  • Create New...