Questions & Answers

Question instructions: Copy the sample question below and write your question. Then someone who reads this will hopefully reply with a good answer.
Answer instructions: Write your answer and then at the end of the answer add your signature by the insert signature button, which is at the rightmost button at the top.

Sample Question (replace with your own topic and copy below)


Development / Java

Q: How I can make custom web addresses?
A: See the Grails guide at section about URL Mappings.

The SCRUM Development Process

User stories

Q: What are user stories?
A: Wikipedia: “In software development and product management, a user story is one or more sentences in the everyday or business language of the end user or user of a system that captures what a user does or needs to do as part of his or her job function.” Or in other words, it is very much like a use case, except it reads more like fiction than technical documentation.


Grails database

Q: Can I get a persistant database for Grails that can also be edited with a visual editor?
A: Yes, you can use embedded h2browser. This can be activated by opening http://localhost:8080/workforecast/dbconsole/login.jsp (change the name of the application to correspond yours) and entering the connection url to the JDBC url and entering connect. There you should be able to see your persistent database tables on the left hand side menu. Click to table you want to see (it will create select query to the sql statement textbox) click Run to run it. You can then use the Edit button that is located below table contents. See the picture below.

You might also need to change the dbCreate=“update” from your DataSource.groovy. If you also want to keep automatic version field from being inserted into all your domain classes (ie. tables) then you need the following code to be included in your domain class static mapping = { version false }

If you have trouble getting your db to persist then change the name of the database from DataSource.groovy, run clean from groovy toolkit Project menu folder. Then change it back to devDB (or whatever you want to use in development environment). It should recompile your project and after this is should be persistent afterwards. If it does not try doing this for different name db first and/or doing couple of clean/build all. It seems that the h2 driver gets somehow stuck in some mode and wont change without clean up.

Grails database, H2 problems

Q: My database does not reset each time or the database console is not available.
A: Check from your project preferences Grails section that your project is set to dev instead of prod.

Grails database, persistence

Q: How can I store the default H2 database to file, so that it won't reset with each server restart and redeployment?
A: Change the connection url from the conf/DataSource.groovy file according to the instructions in . Example:

    development {
        dataSource {
            dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:h2:file:~/myproject.h2db;MVCC=TRUE;LOCK_TIMEOUT=10000"
Virtual Machines in Classroom 6216

Q: My VM doesn't start and makes a permission error. What should I do?
A: Your VM has insufficient permissions to run after extraction from the ZIP file. Right-click the extracted directory, go to properties, then the security tab and grant the full control permission to authenticated users.