Geert,
    I have attached a sample application that proves the problem I am
having.  Included with this tar.gz is a README file that should tell
you how to get Maven configured with the RIFE 1.6.1 jar and how to run
it.  The source is so simple that viewing it should make a lot of
sense.  Visiting the RIFE site as explained in the README should also
give you some output to explain why I'm having this problem.  If you
need anything else, please let me know.  Also, I hope I've just done
something stupid.

Take care,

Jeremy

On 8/15/07, Jeremy Whitlock <[EMAIL PROTECTED]> wrote:
> Hi All,
>     To make this as easy to diagnose as possible, I have decided to
> post non-obfuscated code:
>
> SQL Trace Output
> -------------------------
> Aug 15, 2007 1:59:28 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : CREATE SEQUENCE SEQ_svnrepositorycontainer
> Aug 15, 2007 1:59:28 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 103ms : CREATE TABLE svnrepositorycontainer (active CHAR(1) NOT
> NULL, authzPath LONGVARCHAR NOT NULL, created TIMESTAMP NOT NULL,
> description VARCHAR(256) NOT NULL, displayName VARCHAR(64) NOT NULL,
> id INTEGER NOT NULL, path LONGVARCHAR NOT NULL, serverType VARCHAR(8)
> NOT NULL, PRIMARY KEY (id), UNIQUE (id), CHECK (active != ''), CHECK
> (authzPath != ''), CHECK (description != ''), CHECK (displayName !=
> ''), CHECK (path != ''), CHECK (serverType != ''), CHECK (serverType
> IN ('Apache','SvnServe')))
> Aug 15, 2007 1:59:28 PM
> org.thoughtspark.sac.elements.ApplicationInitializer$Deployer install
> INFO: Table created for SVNRepositoryContainer
> Aug 15, 2007 1:59:28 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : CREATE SEQUENCE SEQ_svnrepository
> Aug 15, 2007 1:59:28 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 18ms : CREATE TABLE svnrepository (active CHAR(1) NOT NULL,
> containerId INTEGER NOT NULL, created TIMESTAMP NOT NULL, dataStore
> VARCHAR(4) NOT NULL, description VARCHAR(256) NOT NULL, displayName
> VARCHAR(64) NOT NULL, id INTEGER NOT NULL, name VARCHAR(64) NOT NULL,
> PRIMARY KEY (id), FOREIGN KEY (containerId) REFERENCES
> svnrepositorycontainer (id), UNIQUE (id), CHECK (active != ''), CHECK
> (containerId != 0), CHECK (dataStore != ''), CHECK (dataStore IN
> ('BDB','FSFS')), CHECK (description != ''), CHECK (displayName != ''),
> CHECK (name != ''))
> Aug 15, 2007 1:59:28 PM
> org.thoughtspark.sac.elements.ApplicationInitializer$Deployer install
> INFO: Table created for SVNRepository
> Aug 15, 2007 2:00:06 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 20ms : SELECT * FROM SVNRepositoryContainer WHERE active = 'Y'
> ORDER BY displayName ASC
> Aug 15, 2007 2:00:53 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 7ms : SELECT count(*) FROM svnrepositorycontainer WHERE id = -1
> Aug 15, 2007 2:00:53 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT count(*) FROM svnrepositorycontainer WHERE
> displayName = 'Some Container' AND active = 'Y'
> Aug 15, 2007 2:00:53 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT count(*) FROM svnrepositorycontainer WHERE path =
> '/Some/path' AND active = 'Y'
> Aug 15, 2007 2:00:53 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 1ms : CALL NEXT VALUE FOR SEQ_svnrepositorycontainer
> Aug 15, 2007 2:00:53 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 112ms : INSERT INTO svnrepositorycontainer (active, authzPath,
> created, description, displayName, id, path, serverType) VALUES (?, ?,
> ?, ?, ?, ?, ?, ?)
> Aug 15, 2007 2:00:54 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 1ms : SELECT * FROM SVNRepositoryContainer WHERE active = 'Y'
> ORDER BY displayName ASC
> Aug 15, 2007 2:01:00 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT * FROM SVNRepository WHERE active = 'Y' ORDER BY
> displayName ASC
> Aug 15, 2007 2:01:00 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT * FROM SVNRepositoryContainer WHERE active = 'Y'
> ORDER BY displayName ASC
> Container Id: 0
> Aug 15, 2007 2:01:20 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT count(*) FROM svnrepository WHERE id = -1
> Aug 15, 2007 2:01:20 PM com.uwyn.rife.database.DbStatement outputTrace
> INFO: 0ms : SELECT * FROM svnrepositorycontainer WHERE id = 0
>
> SVNRepository.java
> ----------------------------
> .....
> public class SVNRepository {
>         private int id = -1;
>         private int containerId;
> .....
>         /**
>          * @return Returns the id.
>          */
>         public int getId() {
>                 return id;
>         }
>         /**
>          * @param id The id to set.
>          */
>         public void setId(int id) {
>                 this.id = id;
>         }
>         /**
>          * Returns the id of the repository container this repository is
>          * associated with.
>          */
>         public int getContainerId() {
>                 return containerId;
>         }
>
>         /**
>          * Sets the repository container id.
>          *
>          * @param The repository container id.
>          */
>         public void setContainerId(int containerId) {
>                 this.containerId = containerId;
>         }
> .....
>
> SVNRepositoryContainer.java
> -----------------------------------------
> .....
> public class SVNRepositoryContainer {
>         private int id = -1;
> .....
>         /**
>          * @return Returns the id.
>          */
>         public int getId() {
>                 return id;
>         }
>         /**
>          * @param id The id to set.
>          */
>         public void setId(int id) {
>                 this.id = id;
>         }
> .....
>
> SVNRepositoryMetaData.java
> -----------------------------------------
> ....
> public SVNRepositoryMetaData extends MetaData {
> .....
>                 addConstraint(new ConstrainedProperty("containerId")
>                         .notEmpty(true)
>                         .notNull(true)
>                         .manyToOne(SVNRepositoryContainer.class, "id")
>                 );
> .....
>
> SVNRepositoriesAdd.java
> ------------------------------------
> .....
> public SVNRepositoriesAdd extends Element {
> .....
>     public void processElement() throws EngineException {
>         SVNRepository bean = getNamedInputBean("Repository");
>
>         if 
> (((Validated)repository).validate(SACUtils.getGenericQueryManager(SVNRepository.class)))
> {
>             ....
>         } else {
>             ....
> .....
> .....
>
> The SQL trace above shows the following:
>
> Creation of the SVNREPOSITORYCONTAINER table
> Creation of the SVNREPOSITORY table
> Creation of necessary sequences
> Creation of a row in the SVNREPOSITORYCONTAINER table with an id of 0
> Attempt to create a row in the SVNREPOSITORY table with a CONTAINERID of 0
>
> The problem is that the validate() call is always returning INVALID.
> Unfortunately, it makes no sense because there is a row in the
> SVNREPOSITORYCONTAINER table with an id of 0.  I have verified this in
> Java code and using a database browsing tool.  Hopefully with exact
> code, this can be easier to diagnose.
>
> Take care,
>
> Jeremy
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: rife-many-to-one-example.tar.gz
Description: GNU Zip compressed data

Reply via email to