Thanks for the reply Ron. I actually wondered if something like that was going on and
I tested that before sending the message. The value *does* exist in that other
table....
select * from lu_process_status where id = 'Q';
.... returns a record. So if I understood your message correctly, that doesn't appear
to be the problem. Any other ideas? Thanks again for your help.
Ron Gallagher <[EMAIL PROTECTED]> wrote:When OJB performs the insert/update, it uses
the value of "id" from the Lu_process_status object that's stored in the
"lu_process_status" field for the value of imports.status_id. If the field
"lu_process_status" is null when you ask ojb to store the object, then ojb will
populate imports.status_id with a null value.
In your code, you're setting status_id on the "newImport" to "Q". However, before you
store "newImport", you need to ensure that the field "lu_process_status" contains a
reference to the object that represents a status of "Q".
Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]
>
> From: C F
> Date: 2003/03/04 Tue AM 10:53:29 EST
> To: [EMAIL PROTECTED]
> Subject: Why is OJB inserting null on one field?
>
>
> Hello,
>
> I'm about 90% sure this problem started happening after I upgraded some stuff (OJB,
> PostgreSQL and JDBC driver). What's happening is that for some reason, on inserting,
> OJB seems to be inserting everything correctly except for my 'status_id' field and I
> have no idea why. Below, I have a code sample, the SQL statement that is being
> received by the database and repository defs. Notice that in the insert statement,
> the status_id field is null despite being explicitly set by
> newImport.setStatus_id("Q")...
>
> Import newImport = new Import();
> newImport.setUser_id(user.getId());
> newImport.setFile_size(new BigDecimal(file.getFileSize()));
> newImport.setIn_file(file.getFileName());
> newImport.setOut_file(outFile.getName());
> newImport.setStatus_id("Q");
> try
> {
> tx = odmg.newTransaction();
> tx.begin();
> tx.lock(layerImport, tx.WRITE);
> tx.commit();
> }
>
>
> ..... the resulting SQL statement is....
>
> INSERT INTO imports
> (file_format,file_size,id,in_file,out_file,request_date,status_id,user_id) VALUES (
> null, 3100237, 21, 'Exports.zip', '0001_60784.zip', null, null, 1 )
>
>
> ....Object Defs....
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------------------------------------
>
> There's nothing wrong with my 'Import' bean. After setting the Status_id, I can
> System.out.println(newImport.getStatus_id()) just fine.
>
> I'm using OJB from CVS a few days ago (0.9.9+) and PostgreSQL 7.3.2 with their JDBC
> 7.3 driver.
>
> Any ideas??
>
> Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more