On 3/24/07, donleyp <[EMAIL PROTECTED]> wrote:
I've just started using AppFuse on a project at work and it really helped me get up and running quickly. Thanks to all the devs on this project for the great product. We use Oracle here and I did not want to start a project using MySQL and possibly get stuck with a bunch of migration problems right before release, so the first thing I did was to deviate from the Quick Start guide and plug in a dependency to the Oracle drivers and the necessary configuration parameters into my POM (this was a breeze: another tip of the hat to you guys).
FYI, in 2.0 M4, we added "database profiles" so it should be much easier to switch databases. http://raibledesigns.com/rd/entry/database_profiles_in_appfuse_2 Matt Everything worked great except for the integration tests! They kept failing
with constraint violations. I pressed on and added my first persistent object with attendant UI using the tutorial as a guide. Again this was a breeze, but I was getting the same integrity violations on my first three attempts to save a new object. After the first three attempts, everything worked great. This behavior is what tipped me off. The oracle sequence object that is created by the hbm2ddl task is initialized to 1. My sample data was exactly three rows numbered 1, 2, and 3. This was also the case with the two sample users in sample-data.xml. I actually have a solution to my own problem... Setting the "id" column values in all of the sample data to negative values will safely place them outside the range of values generated by the sequence. This is actually a pretty good practice that I have used in the past to make test data easier to handle. Not only does it avoid collisions with various artificial key generators, it also makes it easy to insert and clean out test data in production databases for troubleshooting. Does anyone else think it would be a good idea for appfuse to adopt this policy of using negative ids for sample data, or are there any databases out there that would choke on this? Obviously, Oracle is fine. I know that SQL Server and MySQL would have no problem with it either. Donley -- View this message in context: http://www.nabble.com/Integration-Test-Failures-When-Using-Oracle-tf3461237s2369.html#a9657230 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- http://raibledesigns.com
