Emitted SQL statement für primarykey-value 0?

2005-06-27 Thread Claude . Glauser
Hi,

When I do an insert operation on a simple persistent class (Adress: int id,
String name, String firstname), then the following sql statements will be
emitted by ojb:

1119851348515|0|1|statement||SELECT ID FROM ADRESSE WHERE ID = '1' 
1119851348515|0|1|statement||INSERT INTO ADRESSE (ID,NAME,VORNAME) VALUES
('1','a1','b1') 
1119851348515|0|1|statement||SELECT ID FROM ADRESSE WHERE ID = '2' 
1119851348515|0|1|statement||INSERT INTO ADRESSE (ID,NAME,VORNAME) VALUES
('2','a2','b') 

But when the primarykey (int type) has the value 0, then only this will be
emitted, without a preceding select statement:

1119853301733|0|1|statement||INSERT INTO ADRESSE (ID,NAME,VORNAME) VALUES
('0','B0','M0') 

Why?
OJB 1.0.3, Broker-API, no autoincrement primarykey.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Emitted SQL statement für primarykey-value 0?

2005-06-27 Thread Thomas Dudziak
When you'e using the type int for your primary key (as opposed to
using Integer), then there isn't a language-provided 'null' value.
However OJB needs such a null value in order to determine whether the
object has already be stored (pk != null) or not. For the primitive
type int, the null value is therefore definied as 0.
I'd suggest you either don't use 0 for your pks or (better) change
your PK to Integer.

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OJB and temporary tables

2005-06-27 Thread Charles Anthony
OK - quick response, no, it is not possible to map to temporary tables in
OJB.

However, it might be possible to dynamically change the repository metadata
to point to the temporary table...



-Original Message-
From: Bruno CROS [mailto:[EMAIL PROTECTED]
Sent: 27 June 2005 10:17
To: OJB Users List
Subject: Re: OJB and temporary tables


Help, please, did someone try to use temporary table ?
 I'm asking me about a turn around, creating records in a ODMG transaction 
and rollback them systematically . Risky, isn't it ? I don't known exactly 
why, but i think there is a better way... 
 Thanks for any ideas
 On 6/23/05, Bruno CROS [EMAIL PROTECTED] wrote: 
 
 Hello,
 
 I did not find any concrete discussings about dealing with temporary
 tables with OJB.
 
 My aim is to check some values against records in OJB tables. The
 query is a complex join query, with multiple records entries.
 
 Make a query for each check will be too heavy and too long. My first
 idea is to insert some records (to be checked) in a temporary table,
 and check them against with a report query.
 
 Is there a better way? Something i miss ?
 
 Does OJB support temporary table mapping? if not, why ?
 
 Evenly, how store procedures would help me ?
 
 Thanks a lot.



___
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OJB and temporary tables

2005-06-27 Thread Bruno CROS
Why change the repository? My first idea was to (re)create the table after 
modifications of the torque generated script of the table. Modifications 
tells something like On commit delete row (Oracle) 
 Then, my table is mapped, for only the time of the transaction, and i use 
only with REportQuery to avoid the cache ghost errors. May be i have to 
mount , unmount the repository table description to be sure the cache is 
cleared ? that's what you tell ?
 Thanks 
 On 6/27/05, Charles Anthony [EMAIL PROTECTED] wrote: 
 
 OK - quick response, no, it is not possible to map to temporary tables in
 OJB.
 
 However, it might be possible to dynamically change the repository 
 metadata
 to point to the temporary table...
 
 
 
 -Original Message-
 From: Bruno CROS [mailto:[EMAIL PROTECTED]
 Sent: 27 June 2005 10:17
 To: OJB Users List
 Subject: Re: OJB and temporary tables
 
 
 Help, please, did someone try to use temporary table ?
 I'm asking me about a turn around, creating records in a ODMG transaction
 and rollback them systematically . Risky, isn't it ? I don't known exactly
 why, but i think there is a better way...
 Thanks for any ideas
 On 6/23/05, Bruno CROS [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I did not find any concrete discussings about dealing with temporary
  tables with OJB.
 
  My aim is to check some values against records in OJB tables. The
  query is a complex join query, with multiple records entries.
 
  Make a query for each check will be too heavy and too long. My first
  idea is to insert some records (to be checked) in a temporary table,
  and check them against with a report query.
 
  Is there a better way? Something i miss ?
 
  Does OJB support temporary table mapping? if not, why ?
 
  Evenly, how store procedures would help me ?
 
  Thanks a lot.
 
 
 
 ___
 HPD Software Ltd. - Helping Business Finance Business
 Email terms and conditions: 
 www.hpdsoftware.com/disclaimerhttp://www.hpdsoftware.com/disclaimer
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Method isDeleted(Identity) in TransactionImpl class

2005-06-27 Thread Armin Waibel

Laurent SIMON wrote:

Ok, thank you for your help. I'll change the code for using TransactionExt
instead of TransactionImpl as soon as possible. I think i'll wait for OJB
1.0.4. Do you have an idea of when it'll be released ?



Hope in near future. Sorry I can't give you an exact release date. There
are still some known issues in 1.0.x branch. Maybe we release version
1.0.4 (soon) and fix the open issues in 1.0.5.

regards,
Armin



-Message d'origine-
De : Armin Waibel [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 22 juin 2005 23:02
À : OJB Users List
Objet : Re: Method isDeleted(Identity) in TransactionImpl class


Laurent SIMON wrote:


I don't speak English very well and I did not understand exactly what you
wanna say in the last paragraph...  In fact, the part of the code which


uses


this method isn't my work, but the person who has written it left the
society so i can't ask him for information.



I only want to explain that in specific rare situations (with specific 
configuration setting) the re-introduced method #isDeleted(Identity) 
return 'false' for a specified object Identity but nevertheless on 
commit the object will be deleted. I don't want to confuse you, so 
please ignore this hint ;-)





The study of his code would take very much time to me, and i don't speak
about the risks of regressions...  It will be easy for me that you
re-introduce this method as you proposed it.




I re-introduce the method and checked in the changes in CVS 1.0.x branch 
(branch is tagged as OJB_1_0_RELEASE). Please check out the 
OJB_1_0_RELEASE branch (otherwise you have to wait for 1.0.4).


I strongly recommend using TransactionExt instead of TransactionImpl to 
get access to #isDeleted


TransactionExt tx = (TransactionExt) odmg.newTransaction()

more info about OJB's odmg extensions:
http://db.apache.org/ojb/docu/guides/odmg-guide.html#OJB+Extensions+of+ODMG

regards,
Armin



-Message d'origine-
De : Armin Waibel [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 22 juin 2005 13:15
À : OJB Users List
Objet : Re: Method isDeleted(Identity) in TransactionImpl class


Hi Lorrain,

Laurent SIMON wrote:



Hello,

I'm using Ojb since version RC5 encapsulated in a persistent framework in


a


large J2EE application. 
I try to migrate to the higher versions earliest after each release, but I

have a problem since version 1.0.3.  Indeed, method isDeleted(Identity) of
the class TransactionImpl has been removed whereas I use it in my


framework.



Why was it deleted without passing by the state deprecated?



We did a huge odmg-implementation refactoring between 1.0.1 and 1.0.3 
(and some more bug fixes will be included in upcoming 1.0.4). I don't 
know that TransactionImpl#isDeleted was used as a official method, 
that's the reason why it was not deprecated.


Now all OJB specific extensions of the odmg-api are encapsulated in the 
OJB extension classes (ImplementationExt, TransactionExt,


EnhancedOQLQuery).

I can add a method #isDeleted to TransactionExt (this is the recommended 
way to use odmg-api extensions) this also (re-)introduce the method in 
TransactionImpl.


Could you tell me why you need this method? There is a pitfall when 
using this method because it could happen that OJB detect removed 
objects as recently as the tx commits. E.g. when you remove some objects 
in a 1:n relation.


regards,
Armin




What can I do
to obtain the same result?  Thank you in advance for your answers.

Regards,
Lorrain



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installment 2, Spring

2005-06-27 Thread Armin Waibel

Hi,

Alexandre Borgoltz wrote:

Jason,

I have not read your articles for the moment but IMHO this is a very 
positive initiative.
I like to work with OJB, and I also appreciate Spring a lot - they are 
both great tools.
Spring aims at integration of various frameworks. It has a strong 
persistence layer integration - integration is great with Hibernate, 
JDO, iBatis. But you will never find any reference to OJB.

I suppose the reasons are mainly political but anyway, it's a shame.


I don't think that the reasons are political (the contact with Juergen 
Hoeller from Spring come along well).
JDO, Hibernate, iBatis are (currently ;-)) more popular than OJB, thus 
in the first instance you will find references about these frameworks.
For OJB-1.1 we intend (among other things) to make the Spring 
integration easier. OJB-1.1 will be a big step forward.



For 
example, Spring is a great factor of expansion for Hibernate, as every 
little sample it provides uses hibernate.


The winner takes it all ;-)

regards,
Armin



It would be a shame if OJB did not take the opportunity.

I am not yet a Spring expert, but tell me if I can help in anyway!

I'd also be interested in reading what you OJB committers (Armin, 
Thomas, Jacob, Martin...) think about it!








Alexandre BORGOLTZ
Head of Technology

SmartJog SA
Phone: +33 (0)1 4996 6324
Fax: +33 (0)1 4996 6405
Mobile: +33 (0)6 8882 1417
[EMAIL PROTECTED]


Jason McKerr wrote:

  I've finished the second (more simple) installment of Spring with OJB 
if anyone is interested.

 
  http://staff.osuosl.org/~mckerrj/?p=4
 
  Jason
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installment 2, Spring

2005-06-27 Thread Armin Waibel

Hi Jason,

Jason McKerr wrote:

Hi Thomas,

If you guys want, feel free to take the two articles that I put up and 
move them into the How-to page.  I will have the third entry done in the 
next few days.




Thanks a lot!
I will add your articles to OJB's Link page.

Jason, if you send me a summing-up of your three articles as normal 
.txt-file I will transform it to a forrest-compatible Howto and add it 
to OJB-docs.


regards,
Armin



Jason

Thomas Dudziak wrote:


On 6/24/05, Jason McKerr [EMAIL PROTECTED] wrote:
 


I've finished the second (more simple) installment of Spring with OJB if
anyone is interested.

http://staff.osuosl.org/~mckerrj/?p=4
  



First off, thanks for sharing this with us ! I use OJB with Spring for
several months now, but never got around writing a tutorial for it ;-)
Just a quick comment: the separation that Matt made concerning DAOs
and services is actually a really good idea because it separates
concerns - your actions want to execute business logic not database
accesses, and you can often want to combine several database accesses
into one business method. Also it greatly simplifies testing because
you can replace the DAOs easily (by using a different
applicationContext file) and thus test your services without having to
have a database at hand but instead against mock DAOs.

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installment 2, Spring

2005-06-27 Thread Jason McKerr

Armin,

I am just finishing up the third article today.  As soon as I get that 
done, I will write this and send along.


Jason

Armin Waibel wrote:


Hi Jason,

Jason McKerr wrote:


Hi Thomas,

If you guys want, feel free to take the two articles that I put up 
and move them into the How-to page.  I will have the third entry done 
in the next few days.




Thanks a lot!
I will add your articles to OJB's Link page.

Jason, if you send me a summing-up of your three articles as normal 
.txt-file I will transform it to a forrest-compatible Howto and add it 
to OJB-docs.


regards,
Armin



Jason

Thomas Dudziak wrote:


On 6/24/05, Jason McKerr [EMAIL PROTECTED] wrote:
 

I've finished the second (more simple) installment of Spring with 
OJB if

anyone is interested.

http://staff.osuosl.org/~mckerrj/?p=4
  




First off, thanks for sharing this with us ! I use OJB with Spring for
several months now, but never got around writing a tutorial for it ;-)
Just a quick comment: the separation that Matt made concerning DAOs
and services is actually a really good idea because it separates
concerns - your actions want to execute business logic not database
accesses, and you can often want to combine several database accesses
into one business method. Also it greatly simplifies testing because
you can replace the DAOs easily (by using a different
applicationContext file) and thus test your services without having to
have a database at hand but instead against mock DAOs.

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installment 2, Spring

2005-06-27 Thread Armin Waibel

Jason McKerr wrote:

Armin,

I am just finishing up the third article today.  As soon as I get that 
done, I will write this and send along.




Great!

Armin



Jason

Armin Waibel wrote:


Hi Jason,

Jason McKerr wrote:


Hi Thomas,

If you guys want, feel free to take the two articles that I put up 
and move them into the How-to page.  I will have the third entry done 
in the next few days.




Thanks a lot!
I will add your articles to OJB's Link page.

Jason, if you send me a summing-up of your three articles as normal 
.txt-file I will transform it to a forrest-compatible Howto and add it 
to OJB-docs.


regards,
Armin



Jason

Thomas Dudziak wrote:


On 6/24/05, Jason McKerr [EMAIL PROTECTED] wrote:
 

I've finished the second (more simple) installment of Spring with 
OJB if

anyone is interested.

http://staff.osuosl.org/~mckerrj/?p=4
  





First off, thanks for sharing this with us ! I use OJB with Spring for
several months now, but never got around writing a tutorial for it ;-)
Just a quick comment: the separation that Matt made concerning DAOs
and services is actually a really good idea because it separates
concerns - your actions want to execute business logic not database
accesses, and you can often want to combine several database accesses
into one business method. Also it greatly simplifies testing because
you can replace the DAOs easily (by using a different
applicationContext file) and thus test your services without having to
have a database at hand but instead against mock DAOs.

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Broker pool size

2005-06-27 Thread Leeuwen, E.W.A. \(Ed\) van
Hi,
 
We have some problems with the broker pool. We would like to be able to
log the current number
outstanding for each pool.  Is there any (easy) way to do this?

(This is the same question (without answer ;-)) David Corbin posed on 7
April 2003)

Best regards,

Groetjes,

Ed 

This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/disclaimer/email.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]