Domino crashes for java library

Hello everybody, i explain the scenario: i need thru web browser to retrieve a file (we suppose a pdf file) stored in a longblob column in a table from a mysql database.i do this launching a lotus script agent scheduled (option never) in a server domino wich call a java class from a java library with the following code:

try{

								Class.forName("com.mysql.jdbc.Driver");

	

				}catch(java.lang.ClassNotFoundException e){

					e.printStackTrace();

				}

					

					dbConn = DriverManager.getConnection("jdbc:mysql://logicalhostname/mysqldatabasename?user=userid&password=password");

			

			dbConn.setAutoCommit(false);

						

			String qry = "SELECT body FROM allegati  WHERE IDCiclo = '"+idciclo+"' AND IDDoc = '"+iddoc+"' AND NomeModulo = '"+nomeModulo+"' AND NomeCampo = '"+nomeCampo+"'";

			PreparedStatement prep = dbConn.prepareStatement(qry);

										 rs = prep.executeQuery();

							if(rs.next()){

				

		blob = (byte[])rs.getObject("body");

		}	

}

finally…end of class…

well, does anybody know why my server domino crashes if the pdf i must retrieve has 800k size while everything works well if i deal with a 2-3 k size file??? the server stops not always at the same point but sometimes at connection level…other times at preparedstatement…rarely in the finally step when i call close method for connection variable…

i tried with “mysql-connector-java-3.0.11-stable-bin.jar” and with “mysql-connector-java-3.0.17-stable-bin.jar”.

Any help will be greatly appreciated…thanks in advance to everybody.

Regards, Daniele.

Subject: Domino crashes for java library

Just to be sure - do you mean that the server crash or the agent simply stops with an exception?

Is there any difference if you run the agent manually from Domino Designer?

/lekkim

Subject: RE: Domino crashes for java library

Thanks for your post Mikkel…sorry for answering so late i was away these last days… no no the server litteraly crashes stopping its “life” and closing itself creating the log error to be sent to IBM support…(but i’ve never sent it of course…)…i try it manually even though it’s a bit complicated 'cause i need some parameter form web pages…i’ll let you know…

Regards, Daniele.

Subject: RE: Domino crashes for java library

Ok…i’ve just tried starting agent manually but it crashes the same …when i connect to pick up large size blob all crashes…server if i’m on a server…client if 'm running it on my client…

Subject: Mistery revealed!!!

Ok…i found the answer and i saw the light!!! I omitted that java library returned to the lotus script agent the byte array got from blob value, and, it seems that when the byte array was larger than 30-35k the script building collapsed, i mean, all worked when java library returned a 2k blob to lotus agent as a byte array, but there were serious problems when the blob to pass was more than 30k.

So i saved blob byte array in a file directly in my java library then i worked with this file in the lotus script agent.

Hope this could help someone in the future…at least not wasting all the time i wasted.

Regards, Daniele.