setStartAtIndex/setEndAtIndex for a very large result set

2004-02-02 Thread ZZZ Liu
Hi, All

I am trying to do a simple query against a very large
table with over 200,000 records. I use QueryByCriteria
without any criteria, but settiing setStartAtIndex(1)
and setEndAtIndex(2). Then I use getIteratorByQuery to
get the result. However, I got OutOfMemory error.

I tried the same thing on a relatively small table
(about 100 records) and it works fine.

Could anybody shed some light on this?

Thanks,
Zhe

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Stored Procedure / returning primary key

2004-02-02 Thread Christoph Bohl
Gurus, 
 
I try to use a stored procedure to insert a table. This works perfectly. The 
stored procedure does correctly return the values that get inserted into the 
database. 
 
Unfortunately, the object I am inserting does not change after the insert 
(toString() before and after). Can you please point out what I am doing wrong? 
Any help is greatly appreciated! 
 
The repository_user.xml: 
 
 
 
 
 
 
 
 
 
 
 
 
 
   
 
The Java code tested (Persistence Broker API): 
PersistenceBroker broker = null; 
 try 
 { 
 broker = 
PersistenceBrokerFactory.defaultPersistenceBroker(); 
 broker.beginTransaction(); 
 broker.store(ztb); 
broker.commitTransaction(); 
 } 
 finally 
 { 
 if (broker != null) broker.close(); 
 } 
 
ODMG API: 
//  Implementation odmg = OJB.getInstance(); 
// Database db = odmg.newDatabase(); 
// try { 
//  
//   db.open("TABI", 
Database.OPEN_READ_WRITE); 
// } catch (Exception e) { 
//System.out.println(e.toString()); 
// } 
//  
//  TransactionExt tx = (TransactionExt) odmg.newTransaction(); 
//  System.out.println("vor insertf: " + ztb.toString()); 
// 
//  tx.begin(); 
//  tx.markDirty(ztb); 
//  tx.commit(); 
 
Thank you very much!! 
 
Cheers, 
Chris 
--  
"When you were born, you were crying and everyone around you was smiling. Live 
your life so that when you die, you’re the one who is smiling and everyone 
around you is crying." 

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



ojb with Sybase

2004-02-02 Thread Zhenwei LI
Hi, I tried to use ojb with Sybase, it did not work.

but the same code worked fine with mysql and sql server.

I wanted to do an easy retrieve  from the Sybase,I met an Exception that is 
"[org.apache.ojb.odmg.collections.DListImpl] ERROR: Generation of new id 
failed
ConnectionManager is NOT in transaction" .

Here is my code,xml and Exception , anyone can give me some clue to solve 
this problem which puzzle me two days.
CODE:
public static List retrieveBook(String bookName){
   Implementation impl = OJB.getInstance();
   Database db=impl.newDatabase();
   try {
   db.open("webpublishSybase",db.OPEN_READ_ONLY);
   } catch (ODMGException e) {
   e.printStackTrace();  //To change body of catch statement use 
Options | File Templates.
   }
   List list=null;
Transaction tx = impl.newTransaction();
   try{



   tx.begin();
   OQLQuery query = impl.newOQLQuery();
   query.create("select results from "+Book.class.getName()+" where 
bookName like $1 ");
   query.bind(bookName);
   DList results = (DList) query.execute();
   tx.commit();
   list=results;

   }catch(Exception e){
e.printStackTrace();
   tx.abort();
   }finally{
   try {
   db.close();
   } catch (ODMGException e) {
   e.printStackTrace();  //To change body of catch statement 
use Options | File Templates.
   }
   }



   return list;
   }
   REPOSITORY_DATABASE.XML
	
  		jcd-alias="webpublishMysql"
  		default-connection="false"
  		platform="MySQL"
  		jdbc-level="3.0"
   useAutoCommit="2"
  		driver="org.gjt.mm.mysql.Driver"
  		protocol="jdbc"
  		subprotocol="mysql"
  
		dbalias="//192.168.0.203/webpublish?seUnicode=true&characterEncoding=gb2312"
  		username="sa"
  		password="nihao123"

   
   />
   
   
   >

   />

   

  Exception:
	[org.apache.ojb.odmg.collections.DListImpl] ERROR: Generation of new id 
failed
ConnectionManager is NOT in transaction
org.apache.ojb.broker.TransactionNotInProgressException: ConnectionManager 
is NOT in transaction
	at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.abortTransaction(Unknown 
Source)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Unknown 
ource)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Unknown 
Source)
	at 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getSequence(Unknown 
Source)
	at 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueLong(Unknown 
Source)
	at 
org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(Unknown 
Source)
	at org.apache.ojb.odmg.collections.DListImpl.generateNewId(Unknown Source)
	at org.apache.ojb.odmg.collections.DListImpl.(Unknown Source)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at java.lang.Class.newInstance0(Class.java:306)
	at java.lang.Class.newInstance(Class.java:259)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
	at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)
	at 
com.scholarbook.webpublish.Persist.ojb.Retrieve.retrieveBook(Retrieve.java:62)
	at com.scholarbook.webpublish.Persist.ojb.Test.main(Test.java:28)
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.TransactionNotInProgressException: ConnectionManager 
is NOT in transaction
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
	at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)
	at 
com.scholarbook.webpublish.Persist.ojb.Retrieve.retrieveBook(Retrieve.java:62)
	at com.scholarbook.webpublish.Persist.ojb.Test.main(Test.java:28)
Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.TransactionNotInProgressException: ConnectionManager 
is NOT in transaction
	at org.apache.ojb.odmg.collections.DListImpl.generateNew

OJB auto-generated Id as Double?

2004-02-02 Thread Phil Armour
All,

I am having issues with generating id's of type double.  The sql below that should 
return the max_key from the OJB_HL_SEQ table returns the value: 11334000 which is 
larger than an Integer can be.  Thus we use a Double for the id's.  However, the OJB 
sequence seems to assume the field MAX_KEY is an integer, and therefore throws a 
Numeric Overflow SQLException as seen in the traces below.  Is this a problem for 
anyone else and has a fix been discussed?

In the logs below i found it interesting that that ojb seems to be looking for a Long:
at 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueLong(SequenceManagerHighLowImpl.java:191)
but the Oracle call seems to be looking for an Int:
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1551)


[Full Exception Trace]:

1075770103075|0|1|statement|SELECT 
A0.MAX_KEY,A0.TABLENAME,A0.GRAB_SIZE,A0.VERSION,A0.FIELDNAME FROM
 OJB_HL_SEQ A0 WHERE (A0.TABLENAME LIKE  ? ) AND A0.FIELDNAME LIKE  ? |SELECT 
A0.MAX_KEY,A0.TABLENAM
E,A0.GRAB_SIZE,A0.VERSION,A0.FIELDNAME FROM OJB_HL_SEQ A0 WHERE (A0.TABLENAME LIKE  
'SEQ_TRK_CASE' )
 AND A0.FIELDNAME LIKE  'ID'
java.sql.SQLException: Numeric Overflow
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
at oracle.jdbc.driver.OracleStatement.getIntValue(OracleStatement.java:3677)
at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:332)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1551)
at com.p6spy.engine.spy.P6ResultSet.getInt(P6ResultSet.java:261)
at 
org.apache.ojb.broker.util.SqlTypeHelper.getObjectFromColumn(SqlTypeHelper.java:573)
at 
org.apache.ojb.broker.util.SqlTypeHelper.getObjectFromColumn(SqlTypeHelper.java:328)
at org.apache.ojb.broker.util.SqlHelper.getObjectFromColumn(SqlHelper.java:169)

...

rethrown as org.apache.ojb.broker.PersistenceBrokerException: Error reading class 
type: org.apache.ojb.broker.util.sequence.HighLowSequence from result set: Numeric 
Overflow
at 
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArrayFrom(RowReaderDefaultImpl.java:171)
at 
org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:426)
at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:263)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1403)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1563)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1599)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1588)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(PersistenceBrokerImpl.java:1856)
at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:291)
at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:291)
at 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getSequence(SequenceManagerHighLowImpl.java:251)
at 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueLong(SequenceManagerHighLowImpl.java:191)
at 
org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(AbstractSequenceManager.java:125)
at 
org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(BrokerHelper.java:303)
at 
org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(BrokerHelper.java:349)
at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(BrokerHelper.java:215)
at org.apache.ojb.broker.Identity.init(Identity.java:165)
at org.apache.ojb.broker.Identity.(Identity.java:129)

...

1075770103125|0|1|rollback||
1075770103125|0|0|rollback||
ERROR 2004-02-02 20:01:43,125 [EMAIL 
PROTECTED]:org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: Can not 
init Identity for given object beans.CaseBean: Could not obtain next object: Error 
reading class type: org.apache.ojb.broker.util.sequence.HighLowSequence from result 
set: Numeric Overflow


Regards,
Phil Armour



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



Date Comparisons

2004-02-02 Thread jeichels

To start off, thank you who can help.  I have looked through examples, docs, etc.  The 
forum "almost" helped.

The end problem is that I am doing a addLessThan on a datetime db field using the PB 
and it is failing likely because of a type casting problem.

I am using Timestamp in my java code.

Using this for my mapping into a DATETIME field in MySql.



Data gets inserted correctly into MySQL or seems to, but when I do 

crit.addLessThan("offerends", new Timestamp(System.currentTimeMillis());


When I print out the query, I get:

Query from class com.model.offer.OfferVO where [offerprice
> 0.0, isdisabled = false, offerends < 2004-01-31 21:59:07.89, 
> offeredProducts.productid = 1000]

It is the time aspect on this which is failing.

The row should return back data, but is failing to do so.


Thank you again for your help.

John

 



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



Re: Installation of OJB

2004-02-02 Thread Armin Waibel
Hi Ralf,

Ralf Bode wrote:
hi ... again :-(

it is really frustratingly...
i turned OTM->true
made:
customer.setCar(car)
broker.store(customer);
I don't know what's wrong with your test, but this will definitely work 
with the PB-api.
You can find many examples in test suite, e.g. 
...broker.AnonymousFieldsTest.

regards,
Armin
but same...
customer is in DB, car not!
:-(
i have read in aritcle in german-javamag
on OJB there was said "all is nice"
or am i to stuid?

i though it would be possible
to store "customer" and his car...
has anyone a "runnig"-case for an idot, like me?
thanks!



 --- Brian McCallister
<[EMAIL PROTECTED]> schrieb: > Objects
are not automatically stored by reachability
-- the car isn't 
inserted because it is attached to Customer. This
*can* actually be 
done in the OTM if Car is a truly dependent object
(otm-dependent 
attribute), but in the PB an object must be made
explicitly persistent.

broker.store(ca);
broker.store(cu);
-Brian

On Feb 2, 2004, at 3:13 PM, Ralf Bode wrote:


Hi Brian,
now i got an "anonym" id
(very nice, so i now have "pure" javaBeans
no technicals in it :-)
i made
cu = new Custiomer();
ca = new Car();
cu.setCar(ca);
broker.store(cu);
now only a customer was in DB

i must add the "auto-*" in descriptor:



now i have a car and a customer,
but custumer.carId is "null" in database...
of course carId is anonym too! ...
any idea? or am i to silly
and i must do pure sql ... as a penalty... ? :-)
in table customer is:
CREATE TABLE CUSTOMER
(
   ID INT PRIMARY KEY AUTO_INCREMENT,
   CARID INT,
   FOREIGN KEY (CARID) REFERENCES CAR(ID)
);
thanks!

--- Ralf Bode <[EMAIL PROTECTED]> schrieb: >
Thanks

Brian,

but do you mean with "anonymous" keys ?

now i have (in classes):
CUSTOMER
car: Car
carId: int
CAR:
id: int
(and the XML desc for it like in mail before)
am i with anon.keys able to "see" car-fk in
database-table CUSTOMER?
after:
broker.store(customer); ?
thanks again, and thanks for your patience.
greetings!



On the FK thing, if you do not use anonymous
FK's

the ID's need to be
managed manually, as well as the references. I
tend

to recommend using
anonymous keys for FK relationships because it
is

very easy to forget
this.
-Brian





-

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


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles:
http://suche.yahoo.de


-

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


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles:
http://suche.yahoo.de


-

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]


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
hi ... again :-(

it is really frustratingly...
i turned OTM->true
made:
customer.setCar(car)
broker.store(customer);

but same...
customer is in DB, car not!
:-(

i have read in aritcle in german-javamag
on OJB there was said "all is nice"

or am i to stuid?

i though it would be possible
to store "customer" and his car...
has anyone a "runnig"-case for an idot, like me?

thanks!




 --- Brian McCallister
<[EMAIL PROTECTED]> schrieb: > Objects
are not automatically stored by reachability
> -- the car isn't 
> inserted because it is attached to Customer. This
> *can* actually be 
> done in the OTM if Car is a truly dependent object
> (otm-dependent 
> attribute), but in the PB an object must be made
> explicitly persistent.
> 
> broker.store(ca);
> broker.store(cu);
> 
> -Brian
> 
> On Feb 2, 2004, at 3:13 PM, Ralf Bode wrote:
> 
> > Hi Brian,
> > now i got an "anonym" id
> > (very nice, so i now have "pure" javaBeans
> > no technicals in it :-)
> >
> > i made
> > cu = new Custiomer();
> > ca = new Car();
> > cu.setCar(ca);
> > broker.store(cu);
> >
> > now only a customer was in DB
> >
> > i must add the "auto-*" in descriptor:
> >  >   name="car"
> >   class-ref="de.ralle.Car"
> >   auto-retrive="true"
> >   auto-update="true"
> >   auto-delete="true">
> >  
> > 
> >
> > now i have a car and a customer,
> > but custumer.carId is "null" in database...
> > of course carId is anonym too! ...
> >
> > any idea? or am i to silly
> > and i must do pure sql ... as a penalty... ? :-)
> >
> >
> > in table customer is:
> > CREATE TABLE CUSTOMER
> > (
> > ID INT PRIMARY KEY AUTO_INCREMENT,
> > CARID INT,
> > FOREIGN KEY (CARID) REFERENCES CAR(ID)
> > );
> >
> > thanks!
> >
> >  --- Ralf Bode <[EMAIL PROTECTED]> schrieb: >
> Thanks
> > Brian,
> >>
> >> but do you mean with "anonymous" keys ?
> >>
> >> now i have (in classes):
> >> CUSTOMER
> >> car: Car
> >> carId: int
> >>
> >> CAR:
> >> id: int
> >>
> >> (and the XML desc for it like in mail before)
> >> am i with anon.keys able to "see" car-fk in
> >> database-table CUSTOMER?
> >> after:
> >> broker.store(customer); ?
> >>
> >> thanks again, and thanks for your patience.
> >> greetings!
> >>
> >>
> >>
> >>> On the FK thing, if you do not use anonymous
> FK's
> >>> the ID's need to be
> >>> managed manually, as well as the references. I
> >> tend
> >>> to recommend using
> >>> anonymous keys for FK relationships because it
> is
> >>> very easy to forget
> >>> this.
> >>>
> >>> -Brian
> >>>
> >>>
> >>>
> >>>
> >>
> >
>
-
> >>> To unsubscribe, e-mail:
> >>> [EMAIL PROTECTED]
> >>> For additional commands, e-mail:
> >>> [EMAIL PROTECTED]
> >>>
> >>
> >>
> >
>
__
> >>
> >> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> >> Mit Yahoo! Suche finden Sie alles:
> >> http://suche.yahoo.de
> >>
> >>
> >
>
-
> >> To unsubscribe, e-mail:
> >> [EMAIL PROTECTED]
> >> For additional commands, e-mail:
> >> [EMAIL PROTECTED]
> >>
> >
> >
>
__
> >
> > Gesendet von Yahoo! Mail - http://mail.yahoo.de
> > Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> >
> >
>
-
> > 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



Re: Installation of OJB

2004-02-02 Thread Brian McCallister
Objects are not automatically stored by reachability -- the car isn't 
inserted because it is attached to Customer. This *can* actually be 
done in the OTM if Car is a truly dependent object (otm-dependent 
attribute), but in the PB an object must be made explicitly persistent.

broker.store(ca);
broker.store(cu);
-Brian

On Feb 2, 2004, at 3:13 PM, Ralf Bode wrote:

Hi Brian,
now i got an "anonym" id
(very nice, so i now have "pure" javaBeans
no technicals in it :-)
i made
cu = new Custiomer();
ca = new Car();
cu.setCar(ca);
broker.store(cu);
now only a customer was in DB

i must add the "auto-*" in descriptor:

 

now i have a car and a customer,
but custumer.carId is "null" in database...
of course carId is anonym too! ...
any idea? or am i to silly
and i must do pure sql ... as a penalty... ? :-)
in table customer is:
CREATE TABLE CUSTOMER
(
ID INT PRIMARY KEY AUTO_INCREMENT,
CARID INT,
FOREIGN KEY (CARID) REFERENCES CAR(ID)
);
thanks!

 --- Ralf Bode <[EMAIL PROTECTED]> schrieb: > Thanks
Brian,
but do you mean with "anonymous" keys ?

now i have (in classes):
CUSTOMER
car: Car
carId: int
CAR:
id: int
(and the XML desc for it like in mail before)
am i with anon.keys able to "see" car-fk in
database-table CUSTOMER?
after:
broker.store(customer); ?
thanks again, and thanks for your patience.
greetings!


On the FK thing, if you do not use anonymous FK's
the ID's need to be
managed manually, as well as the references. I
tend
to recommend using
anonymous keys for FK relationships because it is
very easy to forget
this.
-Brian





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


__
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles:
http://suche.yahoo.de

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

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Forcing materialization of a dynamic proxy object

2004-02-02 Thread Coup, Robert Muir
Hi,

That worked beautifully! This class needs to be added in the docs
somewhere...

Thanks,
Rob :)

> -Original Message-
> From: Thierry Hanot [mailto:[EMAIL PROTECTED] 
> Sent: Monday, 2 February 2004 8:33 p.m.
> To: 'OJB Users List'
> Subject: RE: Forcing materialization of a dynamic proxy object
> 
> 
> Try this 
> It should work :)
> 
> import org.apache.ojb.broker.util.ProxyHelper;
> 
> 
> ...
> 
> ProxyHelper.getRealObject(iter.next());
> 
> 
> B.R 
> 
> T.H
> 
> 
> -Original Message-
> From: Coup, Robert Muir [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 02, 2004 4:27 AM
> To: [EMAIL PROTECTED]
> Subject: Forcing materialization of a dynamic proxy object
> 
> 
> Hi all,
> 
> I have searched through the archives and can't seem to find 
> any answer. How can I force a proxy to materialize its 
> object, or to replace the proxy object witht the real object?
> 
> I have a collection of Group objects within a Paper object. 
> Group's are proxied dynamically (group, staffgroup), and can 
> be of two types - groupimpl or staffgroupimpl. Groupimpl is 
> the parent of staffgroupimpl.
> 
> When the Paper objects collection arrives, it is a bunch of 
> proxy objects. In one operation, I must manipulate the 
> staffgroups in the paper.groups collection.
> 
> For (Iterator iter=groups.iterator; iter.hasNext;) {
>   Group g = (Group)iter.next();
>   if (g instanceof StaffGroup) {
>   ...
>   }
> }
> 
> This fails because none of the objects are seen as 
> StaffGroup's. Even attempting to resolve them through a call 
> to .getSomething() seems to leave the objects as $Proxy2's
> 
> Ideas?
> 
> Thanks,
> Robert Coup
> 
> 
> 
> Classes:
>   Interface Group
>   Interface StaffGroup extends Group
>   
>   Class GroupImpl implements Group
>   Class StaffGroupImpl extends GroupImpl implements StaffGroup
> 
> Repository:
> 
> 
> 
> 
>  proxy="dynamic">
>    Fields ...
> 
> 
> 
> 
> 
>  proxy="dynamic">
>    Fields ...
> 
> 
> 
>    Fields ...
>  name="groups" 
> element-class-ref="Group"
> auto-retrieve="true"
> auto-update="false"
> >
>   ...
> 
> 
> 
> -
> 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: Installation of OJB

2004-02-02 Thread Ralf Bode
Hi Brian,
now i got an "anonym" id
(very nice, so i now have "pure" javaBeans
no technicals in it :-)

i made 
cu = new Custiomer();
ca = new Car();
cu.setCar(ca);
broker.store(cu);

now only a customer was in DB

i must add the "auto-*" in descriptor:

 


now i have a car and a customer,
but custumer.carId is "null" in database...
of course carId is anonym too! ...

any idea? or am i to silly
and i must do pure sql ... as a penalty... ? :-)


in table customer is:
CREATE TABLE CUSTOMER
(
ID INT PRIMARY KEY AUTO_INCREMENT,
CARID INT,
FOREIGN KEY (CARID) REFERENCES CAR(ID)
);

thanks!

 --- Ralf Bode <[EMAIL PROTECTED]> schrieb: > Thanks
Brian,
> 
> but do you mean with "anonymous" keys ?
> 
> now i have (in classes):
> CUSTOMER
> car: Car
> carId: int
> 
> CAR:
> id: int
> 
> (and the XML desc for it like in mail before)
> am i with anon.keys able to "see" car-fk in
> database-table CUSTOMER?
> after:
> broker.store(customer); ?
> 
> thanks again, and thanks for your patience.
> greetings!
> 
> 
> 
> > On the FK thing, if you do not use anonymous FK's
> > the ID's need to be 
> > managed manually, as well as the references. I
> tend
> > to recommend using 
> > anonymous keys for FK relationships because it is
> > very easy to forget 
> > this.
> > 
> > -Brian
> > 
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >  
> 
>
__
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



Re: Installation of OJB

2004-02-02 Thread Brian McCallister
Anonymous keys:

http://db.apache.org/ojb/howto-use-anonymous-keys.html

-Brian

On Feb 2, 2004, at 2:05 PM, Ralf Bode wrote:

Thanks Brian,

but do you mean with "anonymous" keys ?

now i have (in classes):
CUSTOMER
car: Car
carId: int
CAR:
id: int
(and the XML desc for it like in mail before)
am i with anon.keys able to "see" car-fk in
database-table CUSTOMER?
after:
broker.store(customer); ?
thanks again, and thanks for your patience.
greetings!


On the FK thing, if you do not use anonymous FK's
the ID's need to be
managed manually, as well as the references. I tend
to recommend using
anonymous keys for FK relationships because it is
very easy to forget
this.
-Brian




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

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
Thanks Brian,

but do you mean with "anonymous" keys ?

now i have (in classes):
CUSTOMER
car: Car
carId: int

CAR:
id: int

(and the XML desc for it like in mail before)
am i with anon.keys able to "see" car-fk in
database-table CUSTOMER?
after:
broker.store(customer); ?

thanks again, and thanks for your patience.
greetings!



> On the FK thing, if you do not use anonymous FK's
> the ID's need to be 
> managed manually, as well as the references. I tend
> to recommend using 
> anonymous keys for FK relationships because it is
> very easy to forget 
> this.
> 
> -Brian
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



Re: Installation of OJB

2004-02-02 Thread Brian McCallister
On Feb 2, 2004, at 1:26 PM, Ralf Bode wrote:

so please not be angry (because of lots questions)
(i last worked with 0.94... sorry)
Thanks advice!
Ralf
Of course not! Your questions are particularly helpful as they point 
out weaknesses in the docs =)

On the FK thing, if you do not use anonymous FK's the ID's need to be 
managed manually, as well as the references. I tend to recommend using 
anonymous keys for FK relationships because it is very easy to forget 
this.

-Brian



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


Re: getCollectionByQuery() hung up in prefetchRelationship()

2004-02-02 Thread Andy Malakov
Jason, I agree with Oleg.

I would try to double JVM heap (-Xmx) or just check GC activity (-verbose:gc) and see 
what happens.

- Original Message - 
From: "Oleg Nitz" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Sunday, February 01, 2004 6:09 AM
Subject: Re: getCollectionByQuery() hung up in prefetchRelationship()


Hi Jason,

On Saturday 31 January 2004 20:18, Jason Woodard wrote:
> but most of the delay I'm seeing (20 minutes vs. 10 seconds) is not 
> the JDBC calls but everything OJB does afterward to hook the bits of 
> the object back together.
This result is really amazing: 20 minutes for purely in-memory operations???
How many millions of object do you load there? Maybe it runs so slow due to 
memory swapping to the disk?

Oleg

-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
Thanks!
now OJB 1.0.rc5 works fine
it makes me now PKs automaticly
thanks

but it doesn´t deal with
foreignkey

customer --> car

i do
cu = new Customer();
cu.setName("foo");
car = new Car();
car.setColor("blue");

cu.setCar(car);

...
broker.store(cu);

okay
in DB is a new car and a new customer.
but carId in table customer is ="0".
(car has a new PK become by db)


in xml i did this in customer-describtion:




in class Customer
i have this:

Car car;
int carId;


any idea?

i watched docu,in internet, saw tutorial3
but it is not deliverd with OJB.

so please not be angry (because of lots questions)
(i last worked with 0.94... sorry)
Thanks advice!
Ralf

 --- Brian McCallister
<[EMAIL PROTECTED]> schrieb: > Your
primary key should be one of the primitive
> wrappers, ie Integer 
> instead of int.
> 
> If you use an int then it is initialized to 0, which
> is saved into the 
> database as it is a valid int =( If you want
> autoincrement to work you 
> need to use the Integer (or Long) wrapper. When the
> pk is null, it will 
> autoincrement.
> 
> 
> public class IncorrectThing
> {
>   public int pk;
> }
> 
> public class CorrentThing
> {
>   public Integer pk;
> }
> 
> IncorrectThing it = new IncorrectThing();
> CorrectThing ct = new CorrectThing();
> 
> If "it" is stored it has a valid value for it.pk -->
> 0
> If "ct" is stored it has null for ct.pk, so will
> have a value assigned.
> 
> -Brian
> 
> On Feb 2, 2004, at 11:47 AM, Ralf Bode wrote:
> 
> > Thanks
> >
> > i am still dealing now without its internals ;-)
> > i didn´t figured it out on page!!
> > Thanks Brenden,!!!
> >
> > one short question - then i am
> > quiet! :-)
> >
> > why must i set the PK in my code?
> >
> > customer.setId(123);
> >
> > i described it in XML
> > primarykey="true"
> > autoincrement="true"
> >
> > but got Errsos, when i dont set up
> > the PK.
> >
> > thanks again for a quick ;-)
> > advice
> >
> > ralf
> >
> > --- "Larry V. Streepy, Jr."
> > <[EMAIL PROTECTED]> schrieb: > I
> struggled
> > with this same problem when learning and
> >> working with OJB.
> >> My final solution was to run the build of OJB and
> >> then setup my project
> >> build to extract the generated SQL (the
> schema.ddl
> >> file) and copy it
> >> into my build area and use ant sql tasks to
> generate
> >> the tables.  I know
> >> that this creates a minor dependency between the
> two
> >> projects, but
> >> that's fairly easy to manage.  I have no need for
> >> setting up and
> >> utilizing torque in my project (I use Axgen to
> >> generate everything from
> >> UML), so it seemed like major complications to
> solve
> >> a simple problem.
> >>
> >> YMMV.
> >> Larry.
> >>
> >> Brian McCallister wrote:
> >>
> >>> I have considered including the torque stuff in
> >> the ojb-blank project
> >>> before, and opted against it as I thought I
> might
> >> be pushing too much
> >>> complexity on users then.
> >>>
> >>> Right now there isn't an *ideal* way to create
> the
> >> internal tables as
> >>> most of the time people don't need them (though
> >> the hi/lo sequence
> >>> table is needed enough that this may be
> incorrect,
> >> since it is the
> >>> default sequence manager).
> >>>
> >>> What are thoughts on including the torque
> >> generator stuff in
> >>> ojb-blank? The ojb-core schema is already
> included
> >> in the src/schema
> >>> directory, but the build-torque and torque
> related
> >> jars are not
> >>> included. Now that I think about it, I have done
> >> this for all of the
> >>> projects I have built around ojb-blank bits
> >> anyway, so that is a
> >>> certain argument in favor.
> >>>
> >>> In the short term, Thomas D has has a nice
> little
> >> walkthrough on
> >>> getting torque from OJB setup in the xdoclet
> docs,
> >> but that is sort of
> >>> hidden =) (note, we should probably move that
> into
> >> its own HOWTO).
> >>>
> >>> -Brian
> >>>
> >>> On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:
> >>>
>  Hi to all,
> 
>  just a question about to install OJB
>  i read, that i have to load the sources and
>  run some build-scripts okay.
> 
>  but is there an easy-way?
>  i only need a build-script for the
> binary-version
>  of OJB, that "installs" OJB-internal-tables
> into
>  database.
> 
>  or is there a reason for "building" all ?
> 
>  thanks for advice!
> 
>  greetings
>  ralf
> 
> 
> >>
> >
>
__
> 
>  Gesendet von Yahoo! Mail - http://mail.yahoo.de
>  Mit Yahoo! Suche finden Sie alles:
> >> http://suche.yahoo.de
> 
> 
> >>
> >
>
-
>  To unsubscribe, e-mail:
> >> [EMAIL PROTECTED]
>  For additional commands, e-mail:
> >> [EMAIL PROTECTED]
> 
> 
> >>>
> >>>
> >>>
> >>>
> >>
> >
>
-
> >>> To 

Re: How to setup this query with OJB-PB

2004-02-02 Thread Jakob Braeuchi
hi dirk,

ReportQueryByCriteria subQuery;
Criteria subCrit = new Criteria();
Criteria crit = new Criteria();
subQuery = QueryFactory.newReportQuery(Schedule.class, subCrit);
subQuery.setColumns(new String[] { "activityId" });
crit.addNotIn("activityId", subQuery);
Query q = QueryFactory.newQuery(Activity.class, crit);
results = broker.getCollectionByQuery(q);

for a working sample please have a look at QueryTest#testSubQuery2.

hth
jakob
Dirk Manske (Service Respond) wrote:
Hi,

I am using PB API and have two classes Activity and Schedule with 1:N
association. Both are declared in the repository-user.xml with a
collection-descriptor as reference.  Now I want to process a query which
results in a collection with all activities where no schedule has been set.
I have read the Query examples carefully but I just don't get it. Could
someone help me with the following sql statement:
SELECT * FROM Activity As act

WHERE act.ACTIVITY_ID NOT IN

(SELECT ACTIVITY_ID FROM SCHEDULE);

Looks so simple, but I cannot figure it out. How to set up this statement
using the Criteria class?
Hope someone can help. thanks,

Dirk

-
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: Installation of OJB

2004-02-02 Thread Brian McCallister
Your primary key should be one of the primitive wrappers, ie Integer 
instead of int.

If you use an int then it is initialized to 0, which is saved into the 
database as it is a valid int =( If you want autoincrement to work you 
need to use the Integer (or Long) wrapper. When the pk is null, it will 
autoincrement.

public class IncorrectThing
{
public int pk;
}
public class CorrentThing
{
public Integer pk;
}
IncorrectThing it = new IncorrectThing();
CorrectThing ct = new CorrectThing();
If "it" is stored it has a valid value for it.pk --> 0
If "ct" is stored it has null for ct.pk, so will have a value assigned.
-Brian

On Feb 2, 2004, at 11:47 AM, Ralf Bode wrote:

Thanks

i am still dealing now without its internals ;-)
i didn´t figured it out on page!!
Thanks Brenden,!!!
one short question - then i am
quiet! :-)
why must i set the PK in my code?

customer.setId(123);

i described it in XML
primarykey="true"
autoincrement="true"
but got Errsos, when i dont set up
the PK.
thanks again for a quick ;-)
advice
ralf

--- "Larry V. Streepy, Jr."
<[EMAIL PROTECTED]> schrieb: > I struggled
with this same problem when learning and
working with OJB.
My final solution was to run the build of OJB and
then setup my project
build to extract the generated SQL (the schema.ddl
file) and copy it
into my build area and use ant sql tasks to generate
the tables.  I know
that this creates a minor dependency between the two
projects, but
that's fairly easy to manage.  I have no need for
setting up and
utilizing torque in my project (I use Axgen to
generate everything from
UML), so it seemed like major complications to solve
a simple problem.
YMMV.
Larry.
Brian McCallister wrote:

I have considered including the torque stuff in
the ojb-blank project
before, and opted against it as I thought I might
be pushing too much
complexity on users then.

Right now there isn't an *ideal* way to create the
internal tables as
most of the time people don't need them (though
the hi/lo sequence
table is needed enough that this may be incorrect,
since it is the
default sequence manager).

What are thoughts on including the torque
generator stuff in
ojb-blank? The ojb-core schema is already included
in the src/schema
directory, but the build-torque and torque related
jars are not
included. Now that I think about it, I have done
this for all of the
projects I have built around ojb-blank bits
anyway, so that is a
certain argument in favor.

In the short term, Thomas D has has a nice little
walkthrough on
getting torque from OJB setup in the xdoclet docs,
but that is sort of
hidden =) (note, we should probably move that into
its own HOWTO).
-Brian

On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:

Hi to all,

just a question about to install OJB
i read, that i have to load the sources and
run some build-scripts okay.
but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.
or is there a reason for "building" all ?

thanks for advice!

greetings
ralf


__
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles:
http://suche.yahoo.de



-
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]
__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Armin Waibel
Hi Ralf,

Ralf Bode wrote:

why must i set the PK in my code?

customer.setId(123);

i described it in XML
primarykey="true"
autoincrement="true"
there is no need to set the PK

but got Errsos, when i dont set up
the PK.
hmm, stack trace will be helpful. I assume you use the default sequence 
manager implementation. These implementation need an internal table for 
work. You can use an alternative sequence manager, e.g. 
SequenceManagerInMemoryImpl - see
http://db.apache.org/ojb/sequencemanager.html#SequenceManager 
implementations

regards,
Armin
thanks again for a quick ;-)
advice 

ralf

--- "Larry V. Streepy, Jr."
<[EMAIL PROTECTED]> schrieb: > I struggled
with this same problem when learning and
working with OJB.  
My final solution was to run the build of OJB and
then setup my project 
build to extract the generated SQL (the schema.ddl
file) and copy it 
into my build area and use ant sql tasks to generate
the tables.  I know 
that this creates a minor dependency between the two
projects, but 
that's fairly easy to manage.  I have no need for
setting up and 
utilizing torque in my project (I use Axgen to
generate everything from 
UML), so it seemed like major complications to solve
a simple problem.

YMMV.
Larry.
Brian McCallister wrote:


I have considered including the torque stuff in
the ojb-blank project 

before, and opted against it as I thought I might
be pushing too much 

complexity on users then.

Right now there isn't an *ideal* way to create the
internal tables as 

most of the time people don't need them (though
the hi/lo sequence 

table is needed enough that this may be incorrect,
since it is the 

default sequence manager).

What are thoughts on including the torque
generator stuff in 

ojb-blank? The ojb-core schema is already included
in the src/schema 

directory, but the build-torque and torque related
jars are not 

included. Now that I think about it, I have done
this for all of the 

projects I have built around ojb-blank bits
anyway, so that is a 

certain argument in favor.

In the short term, Thomas D has has a nice little
walkthrough on 

getting torque from OJB setup in the xdoclet docs,
but that is sort of 

hidden =) (note, we should probably move that into
its own HOWTO).

-Brian

On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:


Hi to all,

just a question about to install OJB
i read, that i have to load the sources and
run some build-scripts okay.
but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.
or is there a reason for "building" all ?

thanks for advice!

greetings
ralf


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles:
http://suche.yahoo.de


-

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]


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Brendan Richards
With autoincrement=true you generally need to setup a database-specific
sequence to handle assigning the value. Or alternatively one of the
internal tables provides this functionality. (bringing the thread
full-circle :-) )

http://db.apache.org/ojb/howto-use-db-sequences.html


-Original Message-
From: Ralf Bode [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 16:47
To: OJB Users List
Subject: Re: Installation of OJB

Thanks

i am still dealing now without its internals ;-)
i didn´t figured it out on page!!
Thanks Brenden,!!!

one short question - then i am
quiet! :-)

why must i set the PK in my code?

customer.setId(123);

i described it in XML
primarykey="true"
autoincrement="true"

but got Errsos, when i dont set up
the PK.

thanks again for a quick ;-)
advice 

ralf

--- "Larry V. Streepy, Jr."
<[EMAIL PROTECTED]> schrieb: > I struggled
with this same problem when learning and
> working with OJB.  
> My final solution was to run the build of OJB and
> then setup my project 
> build to extract the generated SQL (the schema.ddl
> file) and copy it 
> into my build area and use ant sql tasks to generate
> the tables.  I know 
> that this creates a minor dependency between the two
> projects, but 
> that's fairly easy to manage.  I have no need for
> setting up and 
> utilizing torque in my project (I use Axgen to
> generate everything from 
> UML), so it seemed like major complications to solve
> a simple problem.
> 
> YMMV.
> Larry.
> 
> Brian McCallister wrote:
> 
> > I have considered including the torque stuff in
> the ojb-blank project 
> > before, and opted against it as I thought I might
> be pushing too much 
> > complexity on users then.
> >
> > Right now there isn't an *ideal* way to create the
> internal tables as 
> > most of the time people don't need them (though
> the hi/lo sequence 
> > table is needed enough that this may be incorrect,
> since it is the 
> > default sequence manager).
> >
> > What are thoughts on including the torque
> generator stuff in 
> > ojb-blank? The ojb-core schema is already included
> in the src/schema 
> > directory, but the build-torque and torque related
> jars are not 
> > included. Now that I think about it, I have done
> this for all of the 
> > projects I have built around ojb-blank bits
> anyway, so that is a 
> > certain argument in favor.
> >
> > In the short term, Thomas D has has a nice little
> walkthrough on 
> > getting torque from OJB setup in the xdoclet docs,
> but that is sort of 
> > hidden =) (note, we should probably move that into
> its own HOWTO).
> >
> > -Brian
> >
> > On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:
> >
> >> Hi to all,
> >>
> >> just a question about to install OJB
> >> i read, that i have to load the sources and
> >> run some build-scripts okay.
> >>
> >> but is there an easy-way?
> >> i only need a build-script for the binary-version
> >> of OJB, that "installs" OJB-internal-tables into
> >> database.
> >>
> >> or is there a reason for "building" all ?
> >>
> >> thanks for advice!
> >>
> >> greetings
> >> ralf
> >>
> >>
>
__
> >>
> >> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> >> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> >>
> >>
>
-
> >> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
Thanks

i am still dealing now without its internals ;-)
i didn´t figured it out on page!!
Thanks Brenden,!!!

one short question - then i am
quiet! :-)

why must i set the PK in my code?

customer.setId(123);

i described it in XML
primarykey="true"
autoincrement="true"

but got Errsos, when i dont set up
the PK.

thanks again for a quick ;-)
advice 

ralf

--- "Larry V. Streepy, Jr."
<[EMAIL PROTECTED]> schrieb: > I struggled
with this same problem when learning and
> working with OJB.  
> My final solution was to run the build of OJB and
> then setup my project 
> build to extract the generated SQL (the schema.ddl
> file) and copy it 
> into my build area and use ant sql tasks to generate
> the tables.  I know 
> that this creates a minor dependency between the two
> projects, but 
> that's fairly easy to manage.  I have no need for
> setting up and 
> utilizing torque in my project (I use Axgen to
> generate everything from 
> UML), so it seemed like major complications to solve
> a simple problem.
> 
> YMMV.
> Larry.
> 
> Brian McCallister wrote:
> 
> > I have considered including the torque stuff in
> the ojb-blank project 
> > before, and opted against it as I thought I might
> be pushing too much 
> > complexity on users then.
> >
> > Right now there isn't an *ideal* way to create the
> internal tables as 
> > most of the time people don't need them (though
> the hi/lo sequence 
> > table is needed enough that this may be incorrect,
> since it is the 
> > default sequence manager).
> >
> > What are thoughts on including the torque
> generator stuff in 
> > ojb-blank? The ojb-core schema is already included
> in the src/schema 
> > directory, but the build-torque and torque related
> jars are not 
> > included. Now that I think about it, I have done
> this for all of the 
> > projects I have built around ojb-blank bits
> anyway, so that is a 
> > certain argument in favor.
> >
> > In the short term, Thomas D has has a nice little
> walkthrough on 
> > getting torque from OJB setup in the xdoclet docs,
> but that is sort of 
> > hidden =) (note, we should probably move that into
> its own HOWTO).
> >
> > -Brian
> >
> > On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:
> >
> >> Hi to all,
> >>
> >> just a question about to install OJB
> >> i read, that i have to load the sources and
> >> run some build-scripts okay.
> >>
> >> but is there an easy-way?
> >> i only need a build-script for the binary-version
> >> of OJB, that "installs" OJB-internal-tables into
> >> database.
> >>
> >> or is there a reason for "building" all ?
> >>
> >> thanks for advice!
> >>
> >> greetings
> >> ralf
> >>
> >>
>
__
> >>
> >> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> >> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> >>
> >>
>
-
> >> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



Re: Installation of OJB

2004-02-02 Thread Brian McCallister
I think Thomas may have hit on the best general purpose option, using 
the Torque tools he has recently written, as the ojb-core schema is 
pretty readily accessible.

-Brian

On Feb 2, 2004, at 10:29 AM, Larry V. Streepy, Jr. wrote:

I struggled with this same problem when learning and working with OJB. 
 My final solution was to run the build of OJB and then setup my 
project build to extract the generated SQL (the schema.ddl file) and 
copy it into my build area and use ant sql tasks to generate the 
tables.  I know that this creates a minor dependency between the two 
projects, but that's fairly easy to manage.  I have no need for 
setting up and utilizing torque in my project (I use Axgen to generate 
everything from UML), so it seemed like major complications to solve a 
simple problem.

YMMV.
Larry.
Brian McCallister wrote:

I have considered including the torque stuff in the ojb-blank project 
before, and opted against it as I thought I might be pushing too much 
complexity on users then.

Right now there isn't an *ideal* way to create the internal tables as 
most of the time people don't need them (though the hi/lo sequence 
table is needed enough that this may be incorrect, since it is the 
default sequence manager).

What are thoughts on including the torque generator stuff in 
ojb-blank? The ojb-core schema is already included in the src/schema 
directory, but the build-torque and torque related jars are not 
included. Now that I think about it, I have done this for all of the 
projects I have built around ojb-blank bits anyway, so that is a 
certain argument in favor.

In the short term, Thomas D has has a nice little walkthrough on 
getting torque from OJB setup in the xdoclet docs, but that is sort 
of hidden =) (note, we should probably move that into its own HOWTO).

-Brian

On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:

Hi to all,

just a question about to install OJB
i read, that i have to load the sources and
run some build-scripts okay.
but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.
or is there a reason for "building" all ?

thanks for advice!

greetings
ralf
__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Larry V. Streepy, Jr.
I struggled with this same problem when learning and working with OJB.  
My final solution was to run the build of OJB and then setup my project 
build to extract the generated SQL (the schema.ddl file) and copy it 
into my build area and use ant sql tasks to generate the tables.  I know 
that this creates a minor dependency between the two projects, but 
that's fairly easy to manage.  I have no need for setting up and 
utilizing torque in my project (I use Axgen to generate everything from 
UML), so it seemed like major complications to solve a simple problem.

YMMV.
Larry.
Brian McCallister wrote:

I have considered including the torque stuff in the ojb-blank project 
before, and opted against it as I thought I might be pushing too much 
complexity on users then.

Right now there isn't an *ideal* way to create the internal tables as 
most of the time people don't need them (though the hi/lo sequence 
table is needed enough that this may be incorrect, since it is the 
default sequence manager).

What are thoughts on including the torque generator stuff in 
ojb-blank? The ojb-core schema is already included in the src/schema 
directory, but the build-torque and torque related jars are not 
included. Now that I think about it, I have done this for all of the 
projects I have built around ojb-blank bits anyway, so that is a 
certain argument in favor.

In the short term, Thomas D has has a nice little walkthrough on 
getting torque from OJB setup in the xdoclet docs, but that is sort of 
hidden =) (note, we should probably move that into its own HOWTO).

-Brian

On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:

Hi to all,

just a question about to install OJB
i read, that i have to load the sources and
run some build-scripts okay.
but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.
or is there a reason for "building" all ?

thanks for advice!

greetings
ralf
__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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: Installation of OJB

2004-02-02 Thread Thomas Dudziak
On Mon, 2 Feb 2004, Brian McCallister wrote:

> I have considered including the torque stuff in the ojb-blank project 
> before, and opted against it as I thought I might be pushing too much 
> complexity on users then.
> 
> Right now there isn't an *ideal* way to create the internal tables as 
> most of the time people don't need them (though the hi/lo sequence 
> table is needed enough that this may be incorrect, since it is the 
> default sequence manager).
> 
> What are thoughts on including the torque generator stuff in ojb-blank? 
> The ojb-core schema is already included in the src/schema directory, 
> but the build-torque and torque related jars are not included. Now that 
> I think about it, I have done this for all of the projects I have built 
> around ojb-blank bits anyway, so that is a certain argument in favor.

Perhaps there is another way. I've added the DBHandling stuff with its
own ant task which would hide the torque dependency from the users (except
for the jars) and also remove the necessity to have duplicate information
about the location of the database (profile and connection descriptor). I
might even be persuaded to add a little HOWTO for db-creation using this
task, using torque, and using commons-sql/the ant sql task ...
The only problem with this is that it needs adapting to the various
OJB-supported databases (creation of databases via JDBC is not at all
standardized) as currently only Hsqldb, Mysql and Postgresql are explictly
supported.
 
Tom



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



Re: Installation of OJB

2004-02-02 Thread Brian McCallister
I have considered including the torque stuff in the ojb-blank project 
before, and opted against it as I thought I might be pushing too much 
complexity on users then.

Right now there isn't an *ideal* way to create the internal tables as 
most of the time people don't need them (though the hi/lo sequence 
table is needed enough that this may be incorrect, since it is the 
default sequence manager).

What are thoughts on including the torque generator stuff in ojb-blank? 
The ojb-core schema is already included in the src/schema directory, 
but the build-torque and torque related jars are not included. Now that 
I think about it, I have done this for all of the projects I have built 
around ojb-blank bits anyway, so that is a certain argument in favor.

In the short term, Thomas D has has a nice little walkthrough on 
getting torque from OJB setup in the xdoclet docs, but that is sort of 
hidden =) (note, we should probably move that into its own HOWTO).

-Brian

On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:

Hi to all,

just a question about to install OJB
i read, that i have to load the sources and
run some build-scripts okay.
but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.
or is there a reason for "building" all ?

thanks for advice!

greetings
ralf
__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
-
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]


Antwort: RE: Antwort: Optimistic locking / select ... for update

2004-02-02 Thread main . nicolai
Hi,

>But basically, yes, you are the first person that I have read about on
this
>list (in 7 years - first subscribed at sourceforge in 1996...)that needs
to
>be able to do optimistic locking without having a field that you can use
as
>a locking field.

If you use a legacy-database that ist used by other systems ( e.g. PL1/
programms)
and you are not allowed to change the structure of the database, you will
have this
problem.

OO mapping-tools (OJB, JDO, EJB etc) are mostly not optimized for using a
existing
database-structure.


Regards
J. Nicolai




|-+->
| |   Charles Anthony   |
| |   <[EMAIL PROTECTED]|
| |   ftware.com>   |
| | |
| |   02.02.04 11:27|
| |   Bitte antworten an|
| |   "OJB Users List"  |
| | |
|-+->
  
>---|
  |
   |
  |An:  "'OJB Users List'" <[EMAIL PROTECTED]> 
  |
  |Kopie:  
   |
  |Thema:   RE: Antwort: Optimistic locking / select ... for update
   |
  
>---|



Hi,
If you want to use optimistic locking with the standard OJB distribution,
you have to have a "locking" field. One approach you could take would be to
create JdbcAccess access implementation which does it's own optimistic
locking; I suggest this as
org.apache.ojb.broker.accesslayer.JdbcAccessImpl is the only place that
OptimisticLockException is thrown.

Another approach (depending on the number of tables, the amount of database
access that is required, and whether your database allows updates on view)
would be to have the locking field stored on an extra table that could be
joined to; create a view that joins the two, and then map your object to
the
view. Here's an (untested, hypothetical) example :

CREATE TABLE ORIGINALTABLE (
ID decimal(10,0) NOT NULL,
OJBCONCRETECLASS   varchar(255),
NAME varchar(30)
)

CREATE TABLE ORIGINALTABLE_LOCK (
ID decimal(10,0) NOT NULL,
OPTIMISTICLOCK integer
)

CREATE VIEW V_ORIGINALTABLE AS
 SELECT ORIGINALTABLE.*, ORIGINALTABLE_LOCK.OPTIMISTIC_LOCK
FROM
ORIGINALTABLE
inner join ORIGINALTABLE_LOCK on ORIGINALTABLE_LOCK.ID =
ORIGINALTABLE.ID



 
   
   


But basically, yes, you are the first person that I have read about on this
list (in 7 years - first subscribed at sourceforge in 1996...)that needs to
be able to do optimistic locking without having a field that you can use as
a locking field.

Cheers,

Charles.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 02 February 2004 10:05
> To: OJB Users List
> Subject: Antwort: Optimistic locking / select ... for update
>
>
>
> Hi,
>
> I was asking about experience with optimistic locking a few
> days ago. Has
> really nobody done that before (as the non responses appear to me).
> Problem was I can't use a "locking field" and couldn't find
> anything I can
> use to produce a  "select for update".
>
> Lasse
>
>
>
>
>
> |-+->
> | |   Lasse |
> | |   Lambrecht/IS-LF1/Allianz-Leben|
> | |   @ALLIANZ-DE   |
> | | |
> | |   19.01.04 17:24|
> | |   Bitte antworten an "OJB Users |
> | |   List" |
> | | |
> |-+->
>
> >-
> --|
>   |
> |
>   |An:  [EMAIL PROTECTED]
> |
>   |Kopie:
> |
>   |Thema:   Optimistic locking / select ... for
> update
> |
>
> >-
> 

Antwort: Re: ObjectCacheEmptyImpl.java

2004-02-02 Thread lasse . lambrecht
Hello Edson,

your reply is not very helpful, but anyway, good for you if that 1 sec
approach works for you.
Turn the cache (EmptyImpl) of and you'll see that some OJB testcases won't
run as expected.

Regards
Lasse








|-+->
| |   "Edson Carlos Ericksson   |
| |   Richter"  |
| |   <[EMAIL PROTECTED]|
| |   ica.com.br>   |
| | |
| |   29.01.04 17:20|
| |   Bitte antworten an "OJB   |
| |   Users List"   |
| | |
|-+->
  
>---|
  |
   |
  |An:  "OJB Users List" <[EMAIL PROTECTED]>   
  |
  |Kopie:  
   |
  |Thema:   Re: ObjectCacheEmptyImpl.java  
   |
  
>---|



Well, it's boring get beginners programmers around me sayind "hey, OJB
doesn't work!!!", and all times I need to tell them that is just because
they are making a bad modelling desing making two-way navigational
references in all objects (kidding)...

I think it's not an priority, because it can be deal with
per-class-descriptor way. In the specific classes the problem occur, I make
a very-really-short object-cache (something like 1000ms solved at all).

I'm just thinking about using a ObjectCache with 1 sec. as default to all
classes, and set Empty only when strictly necessary. But it could be done
only after june, where our app will be completelly stabilized

Thanks,

Edson Richter


  - Original Message -
  From: Armin Waibel
  To: OJB Users List
  Sent: Thursday, January 29, 2004 2:11 PM
  Subject: Re: ObjectCacheEmptyImpl.java


  Hi Lasse,

  [EMAIL PROTECTED] wrote:
  > Hi,
  >
  > while running the OJB testcases I got a lot of circular problems when
using
  > the ObjectCacheEmptyImpl (no Cache).
  > I'm using RC5 and saw, that the class is empty. Unlike in RC4 where
there
  > is code in this class. I checked the CVS and since version 1.9 it's
empty.
  > Whats the reason for this and are there any recommendations how to
handle
  > circular references in a non-cached environment?

  You can use ObjectCachePerBrokerImpl. This class is similar to the old
  version of ObjectCacheEmptyImpl, but only clear cache on PB.close and
  PB.rollback.

  I removed support for cicular references in ObjectCacheEmptyImpl,
  because all docs said that this class is a really noop-impl and does not
  support circular references.

  Should I add support for cicular references again to this class?

  regards,
  Armin

  >
  > Regards
  > Lasse
  > ___
  >
  >
  >> Lasse Lambrecht
  >> Allianz Lebensversicherungs-AG
  >> IS-LF1 K6, Produktdatenbank
  >> +49 711 663 5412  #  1021-5412
  >
  >
  >
  >
  >
  >
  > -
  > 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]



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.574 / Virus Database: 364 - Release Date: 29/1/2004





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



RE: Installation of OJB

2004-02-02 Thread Thomas Dudziak
On Mon, 2 Feb 2004, Daniel Perry wrote:
 
> I've always intended to figure this out, but never got round to it.  I'm
> currently writing java code (semi generated by eclipse), then hand coding
> the repository and ddl files.  Now having to build versions of software for
> multiple databases, i am getting a bit bogged down with the specifics. I
> cant find "xdoclet-module.html" anywhere? is there any information out there
> for this? I think a tutorial/basic example would help.

This depends on which version you use. In rc5 the xdoclet module was still
in the contrib folder along with its documentation. However I suggest you
use the CVS version of at least the xdoclet module as it has quite a few
additional features and several bugs have been fixed. If you do not want
to use OJB from CVS, then you can get the xdoclet module and its
documentation from the CVS view on the OJB site:

http://cvs.apache.org/viewcvs.cgi/db-ojb/lib/xdoclet-1.2.jar
http://cvs.apache.org/viewcvs.cgi/db-ojb/lib/xdoclet-ojb-module-1.2.jar
http://cvs.apache.org/viewcvs.cgi/db-ojb/lib/xjavadoc-1.0.2.jar
http://cvs.apache.org/viewcvs.cgi/db-ojb/xdocs/xdoclet-module.xml

The last file contains the documentation which you can build with 'ant
docs' using OJB's build file.

Tom


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



RE: Installation of OJB

2004-02-02 Thread Daniel Perry


>>If you want to start with the Java source (and have control over it), then
>>the easiest way would be to use the XDoclet module, in which case it
>>bascially amounts to adding special javadoc tags to your source code, and
>>then invoking an ant task in your build file that creates the repository
>>descriptor (repository_user.xml) and a corresponding torque database
>>schema. Details on the module and the usage of the torque schema can be
>>found in the corresponding documentation (xdoclet-module.html). I suggest
>>you use the CVS version or at least 1.0rc5 if you want to work this way.

I've always intended to figure this out, but never got round to it.  I'm
currently writing java code (semi generated by eclipse), then hand coding
the repository and ddl files.  Now having to build versions of software for
multiple databases, i am getting a bit bogged down with the specifics. I
cant find "xdoclet-module.html" anywhere? is there any information out there
for this? I think a tutorial/basic example would help.

Thanks,
Daniel.


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



RE: Installation of OJB

2004-02-02 Thread Thomas Dudziak
On Mon, 2 Feb 2004, [iso-8859-1] Ralf Bode wrote:

> Hi thank you,
> 
> but i really do only search a "small" solution,
> whichs only builds my internal ojb-talbes.
> 
> if was, i would load a deliverd
> obj-core.sql into my database.
> 
> this would be enough, i am on a "lerning-trip"
> so tools like xdoclet seams to be "overdosed"

Well you can always create a schema file from scratch - the syntax is not
so complicated
(http://db.apache.org/torque-31/generator/schema-reference.html) - and
then invoke the appropriate ant tasks (see the prepare-testdb task in the
ojb build file, and the xdoclet module docs) to insert it into the db.
If you know your sql, you could even use the core task 'sql' of ant,
though I don't recommend that.

And for you learning trip, you shouldn't need the interal OJB tables
(OJB_***) anyway as they're only required for ODMG.
 
Tom



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



RE: Installation of OJB

2004-02-02 Thread Ralf Bode
okay...

let me ask,
you do not have any of its internal-tables?

in my case i need only "makePersisten"
and getCollectionByQuery, and getObjectByQuery

really, i wondered, that the tables are empty!
(since now i use the created core-obj.sql
to load it in my database...
what a dirty workaround, isn´t it?:-)

thank you!!!
you made me happy! :-)

but, why is this not told in anyway on the web-page?


 --- Brendan Richards <[EMAIL PROTECTED]> schrieb:
> I'm not using any. So far I've not used any features
> that require them
> but this may change...
> 
> 
> -Original Message-
> From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2004 10:43
> To: OJB Users List
> Subject: RE: Installation of OJB
> 
> Thanks Brendan,
> 
> but it doesn´t work!
> but this would be the way i likded ;-)
> 
> how do you get your internal tables?
> 
> --- Brendan Richards <[EMAIL PROTECTED]> schrieb:
> >
> Looking in the source tree, the torque schema files
> > are in src/schema.
> > There are three files:
> > ojbcore-schema.xml
> > ojbtest-schema.xml
> > ojbtest-data.xml
> > 
> > There seems to be loads of targets in
> > ./build-torque.xml but none of
> > them seem to specifically build just the internal
> > tables, they seem to
> > do a wildcard *-schema.xml.
> > 
> > Perhaps if you remove the two test files and run a
> > build you'll only get
> > the core tables created?
> > I'd be interested to see if this works. I myself
> > would like to see a
> > specific core-only build target. Although it's
> nice
> > to see the junit
> > tests run and verify that it all works, I don't
> want
> > to deploy all the
> > test tables with my final app...
> > 
> > 
> > 
> > -Original Message-
> > From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> > Sent: 02 February 2004 09:55
> > To: OJB Users List
> > Subject: RE: Installation of OJB
> > 
> > Hi Brendan,
> > 
> > yes i know, that i need its internal tables
> > 
> > perhaps my 1. mail was not easy to understand.
> > sorry for that.
> > 
> > I installed ojb like suggested in "Getting
> started"
> > so i have a database called "ojb"
> > which is full of tables i do not need!
> > 
> > i am searching for "template", where
> > i can define my-project-schema.xml
> > 
> > after runing ant(on that template) i have a
> database
> > "my-project"
> > which has only obj- and my tables.
> > 
> > i think, that would be the most interessting
> > for users, which like the brilliant way to work
> with
> > broker. i like it really, but i dont like the
> whole
> > tables (zoo,reptile, etc) :-)
> > 
> > perhaps there is an tutorial, i didnt found it
> yet!
> > 
> > thanks for advice!
> > 
> > greetings
> > ralf
> > 
> > 
> >  --- Brendan Richards <[EMAIL PROTECTED]>
> > schrieb:
> > > You only need the internal tables to use certain
> > > features. 
> > > 
> > > I'm using a database sequence for my primary
> keys
> > > and I've not needed
> > > any of the other stuff yet so all I've done is
> > > included all the jars
> > > from the binary dist into my classpath along
> with
> > a
> > > copy of the
> > > repository xml files rewritten for my app.
> > >
> >
> http://db.apache.org/ojb/howto-use-db-sequences.html
> > > 
> > > This doc more specifically covers what you need
> > for
> > > deployment:
> > > http://db.apache.org/ojb/deployment.html
> > > 
> > > -Original Message-
> > > From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> > > Sent: 02 February 2004 08:19
> > > To: [EMAIL PROTECTED]
> > > Subject: Installation of OJB
> > > 
> > > Hi to all,
> > > 
> > > just a question about to install OJB
> > > i read, that i have to load the sources and 
> > > run some build-scripts okay.
> > > 
> > > but is there an easy-way?
> > > i only need a build-script for the
> binary-version
> > > of OJB, that "installs" OJB-internal-tables into
> > > database.
> > > 
> > > or is there a reason for "building" all ?
> > > 
> > > thanks for advice!
> > > 
> > > greetings
> > > ralf
> > > 
> > >
> >
>
__
> > > 
> > > Gesendet von Yahoo! Mail - http://mail.yahoo.de
> > > Mit Yahoo! Suche finden Sie alles:
> > > http://suche.yahoo.de
> > > 
> > >
> >
>
-
> > > 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]
> > >  
> > 
> >
>
__
> > 
> > Gesendet von Yahoo! Mail - http://mail.yahoo.de
> > Mit Yahoo! Suche finden Sie alles:
> > http://suche.yahoo.de
> > 
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >

RE: Installation of OJB

2004-02-02 Thread Ralf Bode
Hi thank you,

but i really do only search a "small" solution,
whichs only builds my internal ojb-talbes.

if was, i would load a deliverd
obj-core.sql into my database.

this would be enough, i am on a "lerning-trip"
so tools like xdoclet seams to be "overdosed"

greetings

 --- Thomas Dudziak <[EMAIL PROTECTED]> schrieb: >
Basically there are two easy ways to getting
> started, though I don't think
> they are properly described in a tutorial yet.
> 
> If you have an existing database that you want to
> manipulate with OJB,
> or you like to start with the database then create
> the Java source code
> for it, then I suggest you look at Druid
> (http://sourceforge.net/projects/druid) which allows
> you to import the
> database/create the database, and then generates OJB
> Java code for it.
> 
> If you want to start with the Java source (and have
> control over it), then
> the easiest way would be to use the XDoclet module,
> in which case it
> bascially amounts to adding special javadoc tags to
> your source code, and
> then invoking an ant task in your build file that
> creates the repository
> descriptor (repository_user.xml) and a corresponding
> torque database
> schema. Details on the module and the usage of the
> torque schema can be
> found in the corresponding documentation
> (xdoclet-module.html). I suggest
> you use the CVS version or at least 1.0rc5 if you
> want to work this way.
> 
> Tom
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



RE: Installation of OJB

2004-02-02 Thread Brendan Richards
I'm not using any. So far I've not used any features that require them
but this may change...


-Original Message-
From: Ralf Bode [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 10:43
To: OJB Users List
Subject: RE: Installation of OJB

Thanks Brendan,

but it doesn´t work!
but this would be the way i likded ;-)

how do you get your internal tables?

--- Brendan Richards <[EMAIL PROTECTED]> schrieb: >
Looking in the source tree, the torque schema files
> are in src/schema.
> There are three files:
> ojbcore-schema.xml
> ojbtest-schema.xml
> ojbtest-data.xml
> 
> There seems to be loads of targets in
> ./build-torque.xml but none of
> them seem to specifically build just the internal
> tables, they seem to
> do a wildcard *-schema.xml.
> 
> Perhaps if you remove the two test files and run a
> build you'll only get
> the core tables created?
> I'd be interested to see if this works. I myself
> would like to see a
> specific core-only build target. Although it's nice
> to see the junit
> tests run and verify that it all works, I don't want
> to deploy all the
> test tables with my final app...
> 
> 
> 
> -Original Message-
> From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2004 09:55
> To: OJB Users List
> Subject: RE: Installation of OJB
> 
> Hi Brendan,
> 
> yes i know, that i need its internal tables
> 
> perhaps my 1. mail was not easy to understand.
> sorry for that.
> 
> I installed ojb like suggested in "Getting started"
> so i have a database called "ojb"
> which is full of tables i do not need!
> 
> i am searching for "template", where
> i can define my-project-schema.xml
> 
> after runing ant(on that template) i have a database
> "my-project"
> which has only obj- and my tables.
> 
> i think, that would be the most interessting
> for users, which like the brilliant way to work with
> broker. i like it really, but i dont like the whole
> tables (zoo,reptile, etc) :-)
> 
> perhaps there is an tutorial, i didnt found it yet!
> 
> thanks for advice!
> 
> greetings
> ralf
> 
> 
>  --- Brendan Richards <[EMAIL PROTECTED]>
> schrieb:
> > You only need the internal tables to use certain
> > features. 
> > 
> > I'm using a database sequence for my primary keys
> > and I've not needed
> > any of the other stuff yet so all I've done is
> > included all the jars
> > from the binary dist into my classpath along with
> a
> > copy of the
> > repository xml files rewritten for my app.
> >
> http://db.apache.org/ojb/howto-use-db-sequences.html
> > 
> > This doc more specifically covers what you need
> for
> > deployment:
> > http://db.apache.org/ojb/deployment.html
> > 
> > -Original Message-
> > From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> > Sent: 02 February 2004 08:19
> > To: [EMAIL PROTECTED]
> > Subject: Installation of OJB
> > 
> > Hi to all,
> > 
> > just a question about to install OJB
> > i read, that i have to load the sources and 
> > run some build-scripts okay.
> > 
> > but is there an easy-way?
> > i only need a build-script for the binary-version
> > of OJB, that "installs" OJB-internal-tables into
> > database.
> > 
> > or is there a reason for "building" all ?
> > 
> > thanks for advice!
> > 
> > greetings
> > ralf
> > 
> >
>
__
> > 
> > Gesendet von Yahoo! Mail - http://mail.yahoo.de
> > Mit Yahoo! Suche finden Sie alles:
> > http://suche.yahoo.de
> > 
> >
>
-
> > 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]
> >  
> 
>
__
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> 
>
-
> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
Thanks Brendan,

but it doesn´t work!
but this would be the way i likded ;-)

how do you get your internal tables?

--- Brendan Richards <[EMAIL PROTECTED]> schrieb: >
Looking in the source tree, the torque schema files
> are in src/schema.
> There are three files:
> ojbcore-schema.xml
> ojbtest-schema.xml
> ojbtest-data.xml
> 
> There seems to be loads of targets in
> ./build-torque.xml but none of
> them seem to specifically build just the internal
> tables, they seem to
> do a wildcard *-schema.xml.
> 
> Perhaps if you remove the two test files and run a
> build you'll only get
> the core tables created?
> I'd be interested to see if this works. I myself
> would like to see a
> specific core-only build target. Although it's nice
> to see the junit
> tests run and verify that it all works, I don't want
> to deploy all the
> test tables with my final app...
> 
> 
> 
> -Original Message-
> From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2004 09:55
> To: OJB Users List
> Subject: RE: Installation of OJB
> 
> Hi Brendan,
> 
> yes i know, that i need its internal tables
> 
> perhaps my 1. mail was not easy to understand.
> sorry for that.
> 
> I installed ojb like suggested in "Getting started"
> so i have a database called "ojb"
> which is full of tables i do not need!
> 
> i am searching for "template", where
> i can define my-project-schema.xml
> 
> after runing ant(on that template) i have a database
> "my-project"
> which has only obj- and my tables.
> 
> i think, that would be the most interessting
> for users, which like the brilliant way to work with
> broker. i like it really, but i dont like the whole
> tables (zoo,reptile, etc) :-)
> 
> perhaps there is an tutorial, i didnt found it yet!
> 
> thanks for advice!
> 
> greetings
> ralf
> 
> 
>  --- Brendan Richards <[EMAIL PROTECTED]>
> schrieb:
> > You only need the internal tables to use certain
> > features. 
> > 
> > I'm using a database sequence for my primary keys
> > and I've not needed
> > any of the other stuff yet so all I've done is
> > included all the jars
> > from the binary dist into my classpath along with
> a
> > copy of the
> > repository xml files rewritten for my app.
> >
> http://db.apache.org/ojb/howto-use-db-sequences.html
> > 
> > This doc more specifically covers what you need
> for
> > deployment:
> > http://db.apache.org/ojb/deployment.html
> > 
> > -Original Message-
> > From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> > Sent: 02 February 2004 08:19
> > To: [EMAIL PROTECTED]
> > Subject: Installation of OJB
> > 
> > Hi to all,
> > 
> > just a question about to install OJB
> > i read, that i have to load the sources and 
> > run some build-scripts okay.
> > 
> > but is there an easy-way?
> > i only need a build-script for the binary-version
> > of OJB, that "installs" OJB-internal-tables into
> > database.
> > 
> > or is there a reason for "building" all ?
> > 
> > thanks for advice!
> > 
> > greetings
> > ralf
> > 
> >
>
__
> > 
> > Gesendet von Yahoo! Mail - http://mail.yahoo.de
> > Mit Yahoo! Suche finden Sie alles:
> > http://suche.yahoo.de
> > 
> >
>
-
> > 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]
> >  
> 
>
__
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> 
>
-
> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



RE: Installation of OJB

2004-02-02 Thread Thomas Dudziak
Basically there are two easy ways to getting started, though I don't think
they are properly described in a tutorial yet.

If you have an existing database that you want to manipulate with OJB,
or you like to start with the database then create the Java source code
for it, then I suggest you look at Druid
(http://sourceforge.net/projects/druid) which allows you to import the
database/create the database, and then generates OJB Java code for it.

If you want to start with the Java source (and have control over it), then
the easiest way would be to use the XDoclet module, in which case it
bascially amounts to adding special javadoc tags to your source code, and
then invoking an ant task in your build file that creates the repository
descriptor (repository_user.xml) and a corresponding torque database
schema. Details on the module and the usage of the torque schema can be
found in the corresponding documentation (xdoclet-module.html). I suggest
you use the CVS version or at least 1.0rc5 if you want to work this way.

Tom



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



RE: Antwort: Optimistic locking / select ... for update

2004-02-02 Thread Charles Anthony
Hi,
If you want to use optimistic locking with the standard OJB distribution,
you have to have a "locking" field. One approach you could take would be to
create JdbcAccess access implementation which does it's own optimistic
locking; I suggest this as 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl is the only place that
OptimisticLockException is thrown.

Another approach (depending on the number of tables, the amount of database
access that is required, and whether your database allows updates on view)
would be to have the locking field stored on an extra table that could be
joined to; create a view that joins the two, and then map your object to the
view. Here's an (untested, hypothetical) example :

CREATE TABLE ORIGINALTABLE ( 
ID  decimal(10,0) NOT NULL,
OJBCONCRETECLASSvarchar(255),
NAME varchar(30)
)

CREATE TABLE ORIGINALTABLE_LOCK ( 
ID  decimal(10,0) NOT NULL,
OPTIMISTICLOCK integer
)

CREATE VIEW V_ORIGINALTABLE AS 
SELECT ORIGINALTABLE.*, ORIGINALTABLE_LOCK.OPTIMISTIC_LOCK FROM
ORIGINALTABLE 
inner join ORIGINALTABLE_LOCK on ORIGINALTABLE_LOCK.ID =
ORIGINALTABLE.ID
 



   
   


But basically, yes, you are the first person that I have read about on this
list (in 7 years - first subscribed at sourceforge in 1996...)that needs to
be able to do optimistic locking without having a field that you can use as
a locking field.

Cheers,

Charles.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 02 February 2004 10:05
> To: OJB Users List
> Subject: Antwort: Optimistic locking / select ... for update
> 
> 
> 
> Hi,
> 
> I was asking about experience with optimistic locking a few 
> days ago. Has
> really nobody done that before (as the non responses appear to me).
> Problem was I can't use a "locking field" and couldn't find 
> anything I can
> use to produce a  "select for update".
> 
> Lasse
> 
> 
> 
> 
> 
> |-+->
> | |   Lasse |
> | |   Lambrecht/IS-LF1/Allianz-Leben|
> | |   @ALLIANZ-DE   |
> | | |
> | |   19.01.04 17:24|
> | |   Bitte antworten an "OJB Users |
> | |   List" |
> | | |
> |-+->
>   
> >-
> --|
>   |   
> |
>   |An:  [EMAIL PROTECTED]
> |
>   |Kopie: 
> |
>   |Thema:   Optimistic locking / select ... for 
> update
> |
>   
> >-
> --|
> 
> 
> 
> Hi all,
> 
> for a webbased application I need an optimistic locking mechanism. My
> application uses an existing database, so I can't (and don't 
> want) add an
> extra locking column to each table.
> How are you others handle this?
> Of Course, I can do the optimistic locking by myself. Saving 
> the original
> object somewhere and reread and compare it before saving. But 
> in this case
> in need a "select...for update" SQL to be sure the row is not 
> modified in
> the meantime. How can I do that with OJB (PB-API prefered).
> 
> Regards
> Lasse
> 
> 
> 
> 
> -
> 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]
> 
> 


___
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: Installation of OJB

2004-02-02 Thread Brendan Richards
Looking in the source tree, the torque schema files are in src/schema.
There are three files:
ojbcore-schema.xml
ojbtest-schema.xml
ojbtest-data.xml

There seems to be loads of targets in ./build-torque.xml but none of
them seem to specifically build just the internal tables, they seem to
do a wildcard *-schema.xml.

Perhaps if you remove the two test files and run a build you'll only get
the core tables created?
I'd be interested to see if this works. I myself would like to see a
specific core-only build target. Although it's nice to see the junit
tests run and verify that it all works, I don't want to deploy all the
test tables with my final app...



-Original Message-
From: Ralf Bode [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 09:55
To: OJB Users List
Subject: RE: Installation of OJB

Hi Brendan,

yes i know, that i need its internal tables

perhaps my 1. mail was not easy to understand.
sorry for that.

I installed ojb like suggested in "Getting started"
so i have a database called "ojb"
which is full of tables i do not need!

i am searching for "template", where
i can define my-project-schema.xml

after runing ant(on that template) i have a database
"my-project"
which has only obj- and my tables.

i think, that would be the most interessting
for users, which like the brilliant way to work with
broker. i like it really, but i dont like the whole
tables (zoo,reptile, etc) :-)

perhaps there is an tutorial, i didnt found it yet!

thanks for advice!

greetings
ralf


 --- Brendan Richards <[EMAIL PROTECTED]> schrieb:
> You only need the internal tables to use certain
> features. 
> 
> I'm using a database sequence for my primary keys
> and I've not needed
> any of the other stuff yet so all I've done is
> included all the jars
> from the binary dist into my classpath along with a
> copy of the
> repository xml files rewritten for my app.
> http://db.apache.org/ojb/howto-use-db-sequences.html
> 
> This doc more specifically covers what you need for
> deployment:
> http://db.apache.org/ojb/deployment.html
> 
> -Original Message-
> From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2004 08:19
> To: [EMAIL PROTECTED]
> Subject: Installation of OJB
> 
> Hi to all,
> 
> just a question about to install OJB
> i read, that i have to load the sources and 
> run some build-scripts okay.
> 
> but is there an easy-way?
> i only need a build-script for the binary-version
> of OJB, that "installs" OJB-internal-tables into
> database.
> 
> or is there a reason for "building" all ?
> 
> thanks for advice!
> 
> greetings
> ralf
> 
>
__
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> 
>
-
> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

-
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]



Antwort: Optimistic locking / select ... for update

2004-02-02 Thread lasse . lambrecht

Hi,

I was asking about experience with optimistic locking a few days ago. Has
really nobody done that before (as the non responses appear to me).
Problem was I can't use a "locking field" and couldn't find anything I can
use to produce a  "select for update".

Lasse





|-+->
| |   Lasse |
| |   Lambrecht/IS-LF1/Allianz-Leben|
| |   @ALLIANZ-DE   |
| | |
| |   19.01.04 17:24|
| |   Bitte antworten an "OJB Users |
| |   List" |
| | |
|-+->
  
>---|
  |
   |
  |An:  [EMAIL PROTECTED]  
  |
  |Kopie:  
   |
  |Thema:   Optimistic locking / select ... for update 
   |
  
>---|



Hi all,

for a webbased application I need an optimistic locking mechanism. My
application uses an existing database, so I can't (and don't want) add an
extra locking column to each table.
How are you others handle this?
Of Course, I can do the optimistic locking by myself. Saving the original
object somewhere and reread and compare it before saving. But in this case
in need a "select...for update" SQL to be sure the row is not modified in
the meantime. How can I do that with OJB (PB-API prefered).

Regards
Lasse




-
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: Installation of OJB

2004-02-02 Thread Ralf Bode
Hi Brendan,

yes i know, that i need its internal tables

perhaps my 1. mail was not easy to understand.
sorry for that.

I installed ojb like suggested in "Getting started"
so i have a database called "ojb"
which is full of tables i do not need!

i am searching for "template", where
i can define my-project-schema.xml

after runing ant(on that template) i have a database
"my-project"
which has only obj- and my tables.

i think, that would be the most interessting
for users, which like the brilliant way to work with
broker. i like it really, but i dont like the whole
tables (zoo,reptile, etc) :-)

perhaps there is an tutorial, i didnt found it yet!

thanks for advice!

greetings
ralf


 --- Brendan Richards <[EMAIL PROTECTED]> schrieb:
> You only need the internal tables to use certain
> features. 
> 
> I'm using a database sequence for my primary keys
> and I've not needed
> any of the other stuff yet so all I've done is
> included all the jars
> from the binary dist into my classpath along with a
> copy of the
> repository xml files rewritten for my app.
> http://db.apache.org/ojb/howto-use-db-sequences.html
> 
> This doc more specifically covers what you need for
> deployment:
> http://db.apache.org/ojb/deployment.html
> 
> -Original Message-
> From: Ralf Bode [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2004 08:19
> To: [EMAIL PROTECTED]
> Subject: Installation of OJB
> 
> Hi to all,
> 
> just a question about to install OJB
> i read, that i have to load the sources and 
> run some build-scripts okay.
> 
> but is there an easy-way?
> i only need a build-script for the binary-version
> of OJB, that "installs" OJB-internal-tables into
> database.
> 
> or is there a reason for "building" all ?
> 
> thanks for advice!
> 
> greetings
> ralf
> 
>
__
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> 
>
-
> 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]
>  

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



RE: Installation of OJB

2004-02-02 Thread Brendan Richards
You only need the internal tables to use certain features. 

I'm using a database sequence for my primary keys and I've not needed
any of the other stuff yet so all I've done is included all the jars
from the binary dist into my classpath along with a copy of the
repository xml files rewritten for my app.
http://db.apache.org/ojb/howto-use-db-sequences.html

This doc more specifically covers what you need for deployment:
http://db.apache.org/ojb/deployment.html

-Original Message-
From: Ralf Bode [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 08:19
To: [EMAIL PROTECTED]
Subject: Installation of OJB

Hi to all,

just a question about to install OJB
i read, that i have to load the sources and 
run some build-scripts okay.

but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.

or is there a reason for "building" all ?

thanks for advice!

greetings
ralf

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

-
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]



Antwort: Re: ObjectCacheEmptyImpl.java

2004-02-02 Thread lasse . lambrecht

Hi Armin,

actually I though the same, the ObjectCachePerBrokerImpl should do the job.
I was just wondering where the code has gone in the EmptyImpl, because the
website says it supports circular references.

Thanks
Lasse






|-+--->
| |   Armin Waibel|
| |   <[EMAIL PROTECTED]|
| |   ait.de> |
| |   |
| |   29.01.04 18:11  |
| |   Bitte antworten |
| |   an "OJB Users   |
| |   List"   |
| |   |
|-+--->
  
>---|
  |
   |
  |An:  OJB Users List <[EMAIL PROTECTED]> 
  |
  |Kopie:  
   |
  |Thema:   Re: ObjectCacheEmptyImpl.java  
   |
  
>---|



Hi Lasse,

[EMAIL PROTECTED] wrote:
> Hi,
>
> while running the OJB testcases I got a lot of circular problems when
using
> the ObjectCacheEmptyImpl (no Cache).
> I'm using RC5 and saw, that the class is empty. Unlike in RC4 where there
> is code in this class. I checked the CVS and since version 1.9 it's
empty.
> Whats the reason for this and are there any recommendations how to handle
> circular references in a non-cached environment?

You can use ObjectCachePerBrokerImpl. This class is similar to the old
version of ObjectCacheEmptyImpl, but only clear cache on PB.close and
PB.rollback.

I removed support for cicular references in ObjectCacheEmptyImpl,
because all docs said that this class is a really noop-impl and does not
support circular references.

Should I add support for cicular references again to this class?

regards,
Armin

>
> Regards
> Lasse
> ___
>
>
>> Lasse Lambrecht
>> Allianz Lebensversicherungs-AG
>> IS-LF1 K6, Produktdatenbank
>> +49 711 663 5412  #  1021-5412
>
>
>
>
>
>
> -
> 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]



Installation of OJB

2004-02-02 Thread Ralf Bode
Hi to all,

just a question about to install OJB
i read, that i have to load the sources and 
run some build-scripts okay.

but is there an easy-way?
i only need a build-script for the binary-version
of OJB, that "installs" OJB-internal-tables into
database.

or is there a reason for "building" all ?

thanks for advice!

greetings
ralf

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

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



RE: Forcing materialization of a dynamic proxy object

2004-02-02 Thread Thierry Hanot
Try this 
It should work :)

import org.apache.ojb.broker.util.ProxyHelper;


...

ProxyHelper.getRealObject(iter.next());


B.R 

T.H


-Original Message-
From: Coup, Robert Muir [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 4:27 AM
To: [EMAIL PROTECTED]
Subject: Forcing materialization of a dynamic proxy object


Hi all,

I have searched through the archives and can't seem to find any answer. How
can I force a proxy to materialize its object, or to replace the proxy
object witht the real object?

I have a collection of Group objects within a Paper object. Group's are
proxied dynamically (group, staffgroup), and can be of two types - groupimpl
or staffgroupimpl. Groupimpl is the parent of staffgroupimpl.

When the Paper objects collection arrives, it is a bunch of proxy objects.
In one operation, I must manipulate the staffgroups in the paper.groups
collection.

For (Iterator iter=groups.iterator; iter.hasNext;) {
Group g = (Group)iter.next();
if (g instanceof StaffGroup) {
...
}
}

This fails because none of the objects are seen as StaffGroup's. Even
attempting to resolve them through a call to .getSomething() seems to leave
the objects as $Proxy2's

Ideas?

Thanks,
Robert Coup



Classes:
Interface Group
Interface StaffGroup extends Group

Class GroupImpl implements Group
Class StaffGroupImpl extends GroupImpl implements StaffGroup

Repository:





 Fields ...






 Fields ...



 Fields ...

...



-
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]