I think connectTimeout is used for making the initial connection to the database.  But the error you describe sounds more like the initial connection succeeds, but then there is a timeout afterwards.  I think the socketTimeout parameter is what would control the timeout during an editing session.  Though the docs say both connectTimeout and socketTimeout are 0 for no timeout by default:

Is socketTimeout specified in the JDBC config, by any chance?

Esme Cowles <[log in to unmask]>

"In the old days, an operating system was designed to optimize the
 utilization of the computer's resources. In the future, its main goal
 will be to optimize the user's time." -- Jakob Nielsen

On 10/6/2011, at 3:05 PM, Cindy Harper wrote:

> I'm asking you all because it's not clear to me how to interact with the AT
> developers directly - the response back from the ATUG list is rather slow,
> and I'm hoping you can give me a technical explanation a la "no, because..."
> rather than just a "no".
> We're trying to adopt Archivists Toolkit at Colgate. We don't have a Java
> developer in-house, but I'm exploring whether I can learn to address minor
> issues myself.
> We're a small liberal arts college, so library policy is to out-source as
> much infrastructure as possible (meaning open source is generally avoided).
> So the MySQL database is hosted on a Lunarpages server, and I can't adjust
> the timeout at the server level. But I'm suspecting that the timeout we're
> seeing is not a timeout of the given MySQL transaction, but instead a
> problem with Hibernate persistence.  The symptom - we edit a record, proceed
> to child records that require much editing - the chunk of data that my
> people are trying to enter at one time takes over 10 minutes to edit.
> During their editing the child records, an error occurs.  AT has added error
> code to sense that when this is a JDBCConnectionError, then it forces you to
> restart.
>       if(errorText.contains("JDBCConnectionException")) {
>            String message = "Database connection has been lost due to a
> server timeout.\n\n" +
>                "Please RESTART the program to continue.  If the problem
> persists, consult your System Administrator.";
> So what I did was add a "&connectTimeout=3600" parameter to the
> SessionFactory database URL.  But I still seem to have trouble with the
> timeout.
> Now, I acknowledge that understanding Hibernate and how it interacts with
> JDBC and altering code in AT may be getting over my head, and that what I
> probably should try next is either putting the database on my local MS SQL
> Server instance, or my test-server instance of MySQL (I don't have a local
> production instance of MySQL), and abandon the hosted server.
> But can any of you add to my knowledge base here, and tell me:
> - is it possible to correct this problem easily in the AT code?
> - is the JDBCConnectionException due to the MySQL server timeout that is
> set by &connectTimeout?
> - is simply adding a parameter to the database URL an effective way of
> making sure that that parameter is used in each opensession instance?
> - I know I have a lot to learn about hibernate - I've located a book to skim
> in Books24x7 - I'll try wikipedia to get a briefer intial grounding. Any
> other advice?
> Cindy Harper, Systems Librarian
> Colgate University Libraries
> [log in to unmask]
> 315-228-7363