Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem reading BLOB from database and looping through VO - Help  RSS feed

 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any help with this would be much appreciated. I have a DAO that I am using to retrieve BLOB images from a database. Upon retrieval, I write them as byte[] types to my Java bean. My PrintPDF servlet class is simply looping through my VOs and accessing each image. The problem is, when we hit the PrintPDF class, the server hangs and CPU for the Portal Server is at 70%.

What am I doing wrong?

GetImagesDAO:


ImageVO:


PrintPDF:


Any help would be much appreciated

Thanks.
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Do you really want to be creating a new instance of ImageVO, then creating an Image instance from it with what would presumably be a null byte array?
 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Ess:



Do you really want to be creating a new instance of ImageVO, then creating an Image instance from it with what would presumably be a null byte array?


Joe, probably not. I haven't used a byte array like this before as part of a VO, so any suggestions you can make would be gratefully received

Thanks.
 
Rob Spoor
Sheriff
Posts: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change into
In your current situation, you are NEVER going forward on your iterator. It keeps pointing at the first element.
 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
Change into
In your current situation, you are NEVER going forward on your iterator. It keeps pointing at the first element.


Rob...spot on! I thought I was advancing the loop in the for increment. Thanks v. much for pointing that out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!