You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by "Ross Gardler (JIRA)" <ji...@apache.org> on 2010/02/09 09:31:28 UTC

[jira] Updated: (WOOKIE-88) "Friendly" error message to recommend clean-db?

     [ https://issues.apache.org/jira/browse/WOOKIE-88?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ross Gardler updated WOOKIE-88:
-------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 0.8.1

> "Friendly" error message to recommend clean-db?
> -----------------------------------------------
>
>                 Key: WOOKIE-88
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-88
>             Project: Wookie
>          Issue Type: Improvement
>            Reporter: Scott Wilson
>            Priority: Minor
>             Fix For: 0.8.1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Several users have now raised the exception thrown when running "ant run" multiple times without cleaning the database. While this is now documented in the installation instructions (and will be added to the FAQ) I was wondering if this is a good case for swallowing the underlying exception and providing a more useful message?
> For example:
>   try {
>         	StringTokenizer st = new StringTokenizer(sqlScript, ";");
>         	while (st.hasMoreTokens()) {
>         		String q = st.nextToken();
>         		dbManager.beginTransaction();
>         		SQLQuery query = dbManager.createSQLQuery(q);
>         		query.executeUpdate();
>         	}
>     		dbManager.commitTransaction();
>         } catch (HibernateException e) {
>         	if (e.getCause().getMessage().contains("duplicate key value")){
>         		throw new IOException("There was a problem setting up the database. If this is not the first time you are running Wookie in" +
>         			"standalone mode, then you should run ant clean-db before running to clear the database.");
>         	} else {
>         		throw e;
>         	}
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.