Hi Luke,

On 1/18/07, Luke McLean <[EMAIL PROTECTED]> wrote:


Thank you Michael for such a detailed response.  We have followed the
advice
given, run 'mvn test' and we get the following error:

Error executing database operation: CLEAN_INSERT Embedded error :
user_role

We thought we would be crafty and create the database first using 'mvn
hibernate3:hbm2ddl' which then resulted in some errors to do with
IDENTITY_INSERT...

Cannot insert explicit value for identity column in table 'user_role' when
IDENTITY_INSERT is set to OFF.


MSSQL inserts are a bit of a pain, but easy enough to fix. You will need to
change the following line in the project's pom.xml to get the dbunit  task
working:

Change the line <type>CLEAN_INSERT</type> to <type>MSSQL_CLEAN_INSERT</type>



Went searching in database and found a setting to do with Identity on the
'user_role' and 'app_user' tables and they were set to 'Yes' so I changed
them to 'No' (nor reason really... just to see what would happen).

When I run 'mvn test' it now complains about the 5 database tables already
existing, and fails miserably.


The failure here is not to do with the tables existing: their existence does
result in an error line in the log you posted, but the build fails because
the JNDI lookup on the datasource has failed in the container started by
Cargo. I will need to get back to you on the correct configuration if you
want to stick with JNDI lookups during testing, but in the meantime perhaps
switch back to using the datasource configured inside the project.

Mike

I think that we will install MySQL to get it up and running and eliminate
all other factors then try the port to MSSQL again.  I have attached the
file generated using command 'mvn integration-test >>error3.log'
http://www.nabble.com/file/5710/error3.log error3.log  in case it sheds
any
additional light.

Luke.
Using Appfuse 2.0 m2 on MSSQL 2005


Hi Luke,

Getting MSQL up and running with AppFuse is a piece of cake - there are
two
main approaches to doing it (note that you still need to do 2 if you want
the AppFuse build to create the database schema for you):

1) You get your data source from JNDI: In this case you simply need to
configure your container to load up JTDS (instructions vary per app
server/servlet container) and you change the
applicationContext-recources.xml file to use jndi to look up the
datasource:
uncomment the line starting <jee:jndi..... and comment out the bean called
dataSource. This approach has the advantage that you can deploy the war
file
into several different environments without needing to change its
contents.

2) You compile user names, passwords, etc into the war (the steps listed
here also allow the AppFuse build to create the database schema for you).
First add the following to the list of dependencies near the bottom of the
pom.xml file:

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>

Now change the properties right at the bottom of the file as follows to
use
JTDS (look for the Database Settings comment):
hibernate.dialect: org.hibernate.dialect.SQLServerDialect
jdbc.groupId: net.sourceforge.jtds
jdbc.artifactId: jtds
jdbc.version: 1.2
jdbc.driverClassName: net.sourceforge.jtds.jdbc.Driver
jdbc.url: jdbc:jtds:sqlserver://<server>:<port>/<database_instance>
(please
see jtds docs for format)
jdbc.username: <db_username>
jdbc.password: <db_password>

And you should be building with MSSQL as the database.

Mike

--
View this message in context:
http://www.nabble.com/jtds-help-tf3032097s2369.html#a8439488
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to