[ http://issues.apache.org/jira/browse/DAYTRADER-14?page=comments#action_12449775 ] Piyush Agarwal commented on DAYTRADER-14: -----------------------------------------
Chris, Glad you like the new feature! I had originally coded to have the SQL exceptions write out to both the browser and the logs, but later I went ahead and disabled the output to the browser output. There were two reasons - 1) There are some SQL statements that we expect to fail. for eg - the scripts have Drop tables commands at the start and then the create table commands. The first time the daytrader db is created all the Drop table commands will fail as no tables exist. I didnt want to write out these exceptions to the browser and confuse the user. 2) In niost cases the SQL Exception is quite verbose and if you have couple of them happen... they can quickly fill up the browser screen completely. So imagine the drop commands above failing and your screen getting flooded with SQL exceptions, plus this is bound to happen on every first install of the Daytrader app and creation of the database. But it does give me an idea. How about I write out the failed SQL command to the browser screen and mention to the user to look up this SQL command and its associated SQL exception in the logs. This way the user will exactly know which SQL command failed, if its one of the SQL commands which shouldn't have failed they can look up the Exception in the logs, if its one of the commands which can generally fail they can safely ignore the message. > Include sql script in the ear and use a gbean to create tables etc > ------------------------------------------------------------------ > > Key: DAYTRADER-14 > URL: http://issues.apache.org/jira/browse/DAYTRADER-14 > Project: DayTrader > Issue Type: Improvement > Components: EJB Tier > Affects Versions: 1.2 > Reporter: David Jencks > Attachments: d-j-plan.xml, DAYTRADER-14.patch, daytrader-14.patch.1019 > > > You can use the DatabaseIntitializationGBean (GERONIMO-2396) in a g. plan and > include the sql script in the ejb module so the database will get created if > not already present. This is way better than the previous hack of including a > pre-built database in the car file. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
