<key-generator name="SEQUENCE" alias="www_patient_comments_seq">
<param name="sequence" value="SEQ_{0}" />
<param name="returning" value="true" />
<param name="trigger" value="true" />
</key-generator>
and
System.out.println("Comment: "+cForm.getComment()+"
"+cForm.getPatientId()+" "+cForm.getPatCommentId());
create(cForm);
returns
Comment: test again jan4.05.test1 null
Apr 5, 2005 3:18:49 PM org.exolab.castor.jdo.engine.SQLEngine create
SEVERE: A fatal error occurred while creating
org.usiis.struts.CommentForm using
SQL: {call INSERT INTO "WWW_PATIENT_COMMENTS"
("USIIS_ID","PATIENT_ID","PROVIDE
R_ID","DATE_CREATED","PAT_COMMENT","SHARE_FLAG") VALUES (?,?,?,?,?,?)
RETURNING
"PAT_COMMENT_ID" INTO ?}
java.sql.SQLException: ORA-01400: cannot insert NULL into
("HL_AIMS"."WWW_PATIEN
T_COMMENTS"."PAT_COMMENT_ID")
ORA-06512: at line 1
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:124)
at
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
at
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:622)
at
oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.
Is the VALUES (?,?,?,?,?,?) the problem? Although I don't know why
they would all be ?
thanks
>>> [EMAIL PROTECTED] 04/05/05 03:10PM >>>
I use following key-generator definition with oracle.
<key-generator name="SEQUENCE" alias="PCV">
<param name="sequence" value="SEQ_{0}" />
<param name="returning" value="true" />
<param name="trigger" value="true" />
</key-generator>
Could you try to add the trigger tag.
Ralf
Eric Anderson schrieb:
>Yup it creats fine with an artifical key. So what could be wrong with
>this sequence...
>
>Creates fine with a insert statement in oracle. I have checked
>spelling.
>
>
>
>>>>[EMAIL PROTECTED] 04/05/05 12:15PM >>>
>>>>
>>>>
>My first bet is something with the key-generator is screwy. Can you
>take that out and see if it will work correctly (just fake the key on
>one)? Everything else looks fine.
>
>As far as the logging go, are you using Log4j at all? If so you can
>set the default logging in the properties file to DEBUG for
org.exolab
>and also change the property in the castor.properties file which is
in
>the castor jar file. (forget which one, but its clearly commented)
>
>On Apr 5, 2005 1:48 PM, Eric Anderson <[EMAIL PROTECTED]> wrote:
>
>
>>Seems as though I have another newbie problem
>>
>> public void create(Object object) throws Exception {
>> Database db = null;
>> try {
>> db = getDatabase();
>> db.begin();
>> db.create(object);
>> db.commit();
>> }
>> catch (Exception e) {
>> db.rollback();
>> throw e;
>> }
>> finally {
>> close(db);
>> }
>> }
>>
>>When I call create(cForm); the java process goes to 99% and hangs
>>
>>
>until
>
>
>>I kill it. Is there some kind of logging I can turn on to see where
>>
>>
>it
>
>
>>is hanging?
>>I am using castor-0.9.5.3.jar and classes12 from oracle 10g (thin
>>client)
>>
>>Here is the mapping.
>>
>><key-generator name="SEQUENCE" alias="www_patient_comments_seq">
>> <param name="sequence" value="www_patient_comments_seq"/>
>> <param name="returning" value="true"/>
>> </key-generator>
>><!-- comments area -->
>><class name="org.usiis.struts.CommentForm" identity="patCommentId"
>>key-generator="www_patient_comments_seq">
>> <!--<cache-type type="unlimited"/>-->
>> <map-to table="WWW_PATIENT_COMMENTS"/>
>> <field name="patCommentId" type="integer"><sql
>>name="pat_comment_id" type="integer"/></field>
>> <field name="usiisId" type="string"><sql name="usiis_id"
>>type="integer"/></field>
>> <field name="patientId" type="string"><sql name="patient_id"
>>type="char"/></field>
>> <field name="providerId" type="string"><sql
>>
>>
>name="provider_id"
>
>
>>type="char"/></field>
>> <field name="date" type="date"><sql name="date_created"
>>type="date"/></field>
>> <field name="comment" type="string"><sql name="pat_comment"
>>type="char"/></field>
>> <field name="share" type="boolean"><sql name="share_flag"
>>type="char[NY]"/></field>
>></class>
>>
>>
>>
>>