You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "O'brien, Tim" <to...@transolutions.net> on 2002/12/14 23:28:05 UTC

Top ten gotchas....

I think all programmers have those days when they spend five or six hours
trying to debug a problem that just won't go away ONLY to discover that
they've typed something in wrong.

I'm trying to compile a list of the top n gotchas one can run into with OJB
- here's the first one...

1. If you errantly type in "primary-key" instead of "primarykey" in a table
with a composite primary key you will run into terrible troubles trying to
update any rows.

Does anyone else have any ideas?  

The purpose of this list is to give people a quick reference to check if
they are trying to debug an OJB related issue and they running out of
patience.  I might help to have a list of very common errors, so people
could refer to a certain list before posting to a mailing list, etc.

Thanks in advance.

--------
Tim O'Brien 
W 847-574-2143
M 847-863-7045




Re: Top ten gotchas....

Posted by "J. Russell Smyth" <dr...@cox.net>.
How about this:

  if you change a class-descriptor by adding/removing a field, make sure
you check all collection and reference descriptors to make sure the
indexes of the reference fields have not changed. This can lead to some
very weird placement of wrong values in wrong columns. In our case we
had a ref field being filled with the wrong value from the referred to
table.


On Sat, 2002-12-14 at 15:28, O'brien, Tim wrote:
> I think all programmers have those days when they spend five or six hours
> trying to debug a problem that just won't go away ONLY to discover that
> they've typed something in wrong.
> 
> I'm trying to compile a list of the top n gotchas one can run into with OJB
> - here's the first one...
> 
> 1. If you errantly type in "primary-key" instead of "primarykey" in a table
> with a composite primary key you will run into terrible troubles trying to
> update any rows.
> 
> Does anyone else have any ideas?  
> 
> The purpose of this list is to give people a quick reference to check if
> they are trying to debug an OJB related issue and they running out of
> patience.  I might help to have a list of very common errors, so people
> could refer to a certain list before posting to a mailing list, etc.
> 
> Thanks in advance.
> 
> --------
> Tim O'Brien 
> W 847-574-2143
> M 847-863-7045
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



Re: Top ten gotchas....

Posted by Gareth Cronin <ga...@kiwiplan.co.nz>.
 From an earlier post I made regarding what happens if you assign 
non-lineal-sequential field-descriptor id attributes in the repository, 
e.g. 1,2,4,5 instead of 1,2,3,4:

"When I saved a new class with a cascade-update collection, OJB would 
assign the same primary key ID to every member of the collection and 
save every member of the collection as though it was the same object. 
Therefore, I'd end up with one row in a database table instead of 10, 
with the values of the row reflecting the last member of the collection 
that was saved."

--Gareth.

O'brien, Tim wrote:
> I think all programmers have those days when they spend five or six hours
> trying to debug a problem that just won't go away ONLY to discover that
> they've typed something in wrong.
> 
> I'm trying to compile a list of the top n gotchas one can run into with OJB
> - here's the first one...
> 
> 1. If you errantly type in "primary-key" instead of "primarykey" in a table
> with a composite primary key you will run into terrible troubles trying to
> update any rows.
> 
> Does anyone else have any ideas?  
> 
> The purpose of this list is to give people a quick reference to check if
> they are trying to debug an OJB related issue and they running out of
> patience.  I might help to have a list of very common errors, so people
> could refer to a certain list before posting to a mailing list, etc.
> 
> Thanks in advance.
> 
> --------
> Tim O'Brien 
> W 847-574-2143
> M 847-863-7045
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


-- 
-------------------
Gareth Cronin
Analyst/Programmer
Kiwiplan NZ Ltd
Ph 2727622 x854
-------------------