Re: Multiple threads using one broker

2003-06-10 Thread Thomas Mahler
Hi,

Yajun Liu wrote:
Does closing broker close database connection? 
connection.close() is called. But we are using connection-pooling!
Thus close() does not close the connection but returns it to the pool!
So it's not expensive, but increases scalability.

cheers,
Thomas
If yes, then it is too
expensive.
--Yajun

- Original Message -
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 4:20 PM
Subject: Re: Multiple threads using one broker


Hi Denis,

- Original Message -
From: "Denis Avdic" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:40 PM
Subject: Multiple threads using one broker


Hi,

I am using OJB with Struts and I have a number of actions that use
persistence broker calls to retrieve and store data.
Now, if I have a number of users using the application, all users
share

the same broker.
PersistenceBroker instance itself is not threadsafe. For this reason
OJB use a PB-pool to allow a per thread handling of PB instances.
Mean each user should get his own PB instance. Get the broker,
do the work, close the broker. Or you have
to synchronize user action.
regards,
Armin

Thus I get collisions where one user would begin a
transaction then another would begin a transaction (and get an
exception) and then first user would commit transaction, and when the
second user would try to commit transaction I get an error.
What can I do to fix this, is there anything in the configuration I
can

do, or does anyone have a trick for this?

my broker is a regular broker I get by calling
PersistenceBrokerFactory.defaultPersistenceBroker();
TIA,

Denis

-
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: 1:m relation not updating

2003-06-10 Thread Thomas Mahler
You have to lock the b elements too if you are using normal collections 
to hold the many-side of the association.

If you were using DList as your collection class this won't be required.

cheers,
thomas
Saman Ghodsian wrote:
Hi there, 

Here is the situation.. Say I have class A and class B   1->m

I created the repository.xml 

Everything works fine when storing A to DB with a couple of B's

Tx.lock(a, Transaction.WRITE);
Tx.Commit
Next step is to load a and add more B's and then save it again.

I created the query. And all a and the related B's get loaded ok

Now I add a couple more B's 
And store a 

Tx.lock(a, Transaction.WRITE);
Also tried 
Tx.lock(a, Transaction.UPGRADE);

But the new B's don't get inserted in DB.
Any ideas
Thanks



Sam

-
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: Multiple threads using one broker

2003-06-10 Thread Thomas Mahler
Hi Denis,

A broker can only handle one tx at a time.
To avoid conflicts with multiple users opening broker transactions in 
parallel you simply have to use one broker per user request.

please study the literature and tutorials on ojb + struts best practices:
http://db.apache.org/ojb/links.html
cheers,
Thomas
Denis Avdic wrote:
Hi,

I am using OJB with Struts and I have a number of actions that use 
persistence broker calls to retrieve and store data.

Now, if I have a number of users using the application, all users share 
the same broker.  Thus I get collisions where one user would begin a 
transaction then another would begin a transaction (and get an 
exception) and then first user would commit transaction, and when the 
second user would try to commit transaction I get an error.

What can I do to fix this, is there anything in the configuration I can 
do, or does anyone have a trick for this?

my broker is a regular broker I get by calling 
PersistenceBrokerFactory.defaultPersistenceBroker();

TIA,

Denis

-
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: Multiple threads using one broker

2003-06-10 Thread Yajun Liu
Does closing broker close database connection? If yes, then it is too
expensive.

--Yajun

- Original Message -
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 4:20 PM
Subject: Re: Multiple threads using one broker


> Hi Denis,
>
> - Original Message -
> From: "Denis Avdic" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2003 9:40 PM
> Subject: Multiple threads using one broker
>
>
> > Hi,
> >
> > I am using OJB with Struts and I have a number of actions that use
> > persistence broker calls to retrieve and store data.
> >
> > Now, if I have a number of users using the application, all users
> share
> > the same broker.
>
> PersistenceBroker instance itself is not threadsafe. For this reason
> OJB use a PB-pool to allow a per thread handling of PB instances.
> Mean each user should get his own PB instance. Get the broker,
> do the work, close the broker. Or you have
> to synchronize user action.
>
> regards,
> Armin
>
> > Thus I get collisions where one user would begin a
> > transaction then another would begin a transaction (and get an
> > exception) and then first user would commit transaction, and when the
> > second user would try to commit transaction I get an error.
> >
> > What can I do to fix this, is there anything in the configuration I
> can
> > do, or does anyone have a trick for this?
> >
> > my broker is a regular broker I get by calling
> > PersistenceBrokerFactory.defaultPersistenceBroker();
> >
> > TIA,
> >
> > Denis
> >
> >
> > -
> > 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]



1:m relation not updating

2003-06-10 Thread Saman Ghodsian
Hi there, 

Here is the situation.. Say I have class A and class B   1->m

I created the repository.xml 

Everything works fine when storing A to DB with a couple of B's

Tx.lock(a, Transaction.WRITE);
Tx.Commit


Next step is to load a and add more B's and then save it again.

I created the query. And all a and the related B's get loaded ok

Now I add a couple more B's 
And store a 


Tx.lock(a, Transaction.WRITE);
Also tried 
Tx.lock(a, Transaction.UPGRADE);

But the new B's don't get inserted in DB.
Any ideas

Thanks



Sam


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



Re: Multiple threads using one broker

2003-06-10 Thread Armin Waibel
Hi Denis,

- Original Message -
From: "Denis Avdic" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:40 PM
Subject: Multiple threads using one broker


> Hi,
>
> I am using OJB with Struts and I have a number of actions that use
> persistence broker calls to retrieve and store data.
>
> Now, if I have a number of users using the application, all users
share
> the same broker.

PersistenceBroker instance itself is not threadsafe. For this reason
OJB use a PB-pool to allow a per thread handling of PB instances.
Mean each user should get his own PB instance. Get the broker,
do the work, close the broker. Or you have
to synchronize user action.

regards,
Armin

> Thus I get collisions where one user would begin a
> transaction then another would begin a transaction (and get an
> exception) and then first user would commit transaction, and when the
> second user would try to commit transaction I get an error.
>
> What can I do to fix this, is there anything in the configuration I
can
> do, or does anyone have a trick for this?
>
> my broker is a regular broker I get by calling
> PersistenceBrokerFactory.defaultPersistenceBroker();
>
> TIA,
>
> Denis
>
>
> -
> 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: Multiple Databases in one repository.xml?

2003-06-10 Thread Armin Waibel
Hi David,

- Original Message -
From: "David C. Hicks" <[EMAIL PROTECTED]>
To: "OJB" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 8:54 PM
Subject: Multiple Databases in one repository.xml?

> From reading through the OJB documentation on repository.xml, I get
the
> impression that it is possible to have connection pools to two
different
> data sources in the same application, however I don't see any way to
map
> which objects are persisted in which data source.

Say you have defined two different jdbc-connection-descriptor
using different datasources with jcd-alias names 'db_1' and 'db_2'.
PBKey key1 = new PBKey("db_1", "user1", "passwd1");
PBKey key2 = new PBKey("db_2", "user2", "passwd2");

PersistenceBroker broker_1 = PBF.createPersistenceBroker(key1);
PersistenceBroker broker_2 = PBF.createPersistenceBroker(key2);

Or is the problem that you get an object of type XY and
you want automatic decide which datasource/broker is
to use?
If so you can use custom-attributes in class-descriptor
tag (of the persistent object metadata):


read with
classdescriptor.getAttribute("datasource")

To get the ClassDescriptor of the given object
you can use MetadataManager.

regards,
Armin

> Has anyone ever tried
> this?  I actually do have a need to do this as I have a component that
> utilizes OJB for persistence that will be embedded in several
> applications.  One of these applications also uses OJB for
persistence,
> but all applications need to share a common database for my component.
>
> Thanks in advance for any input,
> Dave
>
>
>
> -
> 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: How do I Select for Update, Select for Read without duplication?

2003-06-10 Thread Shane Mingins
Hi Thomas

Thanks for that.  I think I actually understand what you mean :-)  

Would you have any code examples of this anywhere that I could through?

Cheers
Shane

P.S. And yes, I wondered if this sort of pattern is in the book P of EAA,
it's on my list of books to order.

-Original Message-
From: Thomas Mahler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 10 June 2003 6:17 p.m.
To: OJB Users List
Subject: Re: How do I Select for Update, Select for Read without
duplication?

Hi Shane,

Here is is a pattern that I'm using:
I call it NestedActivitity.
A NestedActivity may be a toplevel activity, that is, it's parent == 
null. Or it may be a sub-activity with a parent != null.

NestedActivity has methods begin() and commit().
if parent == null begin() opens a transaction.
if parent == null commit() commits the transaction.

This trick prevents the child activities to directly access transactions.
This trick also allows to have arbitrary nestings of business activities.

I don't know if this is a pattern that is already listed somewhere, 
maybe in one of Martin Fowlers books.

cheers,
Thomas


Shane Mingins wrote:
> H
> 
> I am using the OJB ODMG API with an application and I am wondering what
> people end up doing to avoid lots of code duplication for CRUD type
> activities.
> 
> If I am doing a CREATE I can create an instance of a new object and pass
> that object to a store(object) method that can:
> 1. open (if not already) an OJB connection 
> 2. start a transaction
> 3. persist the object
> 4. commit the transaction
> 
> If I am going to READ the object I can call a read(objectKey) method
passing
> the object key etc:
> 1. open (if not already) an OJB connection 
> 2. start a transaction
> 3. create and execute my query, i.e. get the object
> 4. commit the transaction
> 5. return the object
> 
> But if I am doing an UPDATE I need to be able to read the object, make
> changes, and persist the changes within a single transaction.  Therefore I
> cannot just reuse my read and store methods.
> 
> Ideally I would like to call a getObject() method on an object manager
class
> and have it read or create and update.
> 
> For example:
> 
> CustomerManager mgr = CustomerManager.get();
> Customer customer =  mgr.getCustomer(name);  // this either creates a new
> customer or returns existing
> 
> ... do some stuff to the customer object 
> 
> mgr.store(customer);  // this will either persist a new customer or update
> an existing
> 
> The key seems to be how to start/abort/commit transactions around the CRUD
> actions.  I was using the join method on the transaction object but I am
not
> sure if that is a good approach or not.
> 
> Can anyone share some advice or perhaps resource that addresses my queries
> in more detail than outlined in the tutorials?  I am guessing that there
is
> some design pattern that perhaps address this but if it is too abstract
(as
> a lot of patterns are) I get lost applying it to my actual situation.
> 
> Thanking You in Advance
> Shane
> 
> Shane Mingins
> Analyst Programmer
> Assure NZ Ltd
> Ph 644 494 2522
> 
> 
> 
> -
> 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: Multiple threads using one broker

2003-06-10 Thread David C. Hicks
It doesn't sound reasonable that different users would collide with one 
another in a transaction environment unless they are always working on 
the same data.  If they *are* working on the same data, then you should 
expect collisions and have your application manage that for the user in 
a clean way.  If your users are working on different pieces of data and 
you're still getting collisions, then my guess is that your data model 
is flawed in some way as to allow this to happen.

Dave

Denis Avdic wrote:

Now, if I have a number of users using the application, all users 
share the same broker.  Thus I get collisions where one user would 
begin a transaction then another would begin a transaction (and get an 
exception) and then first user would commit transaction, and when the 
second user would try to commit transaction I get an error.



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


Re: Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Mauricio CASTRO
May be you have DB constraints set like a PK. May be you have a unique
restriction in the lead table and you already inserted a record with fn=eric
and ln=Northam. Try to change the data and run it again or delete all the
tables.


"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious"
--Orwell 1984
- Original Message - 
From: "Eric Northam" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:41 PM
Subject: RE: Non-decomposed m:n mappings with ODMG


> Sure thing,
>
> The following causes a BatchUpdateException:
>
> Invalid argument value,  message from server: "Duplicate entry '41' for
key
> 1"
> java.sql.BatchUpdateException: Invalid argument value,  message from
server:
> "Duplicate entry '41' for key 1
>
> at
> com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1367)
> at
>
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecut
> e(Unknown Source)
> at
>
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
> nknown Source)
> at $Proxy0.doExecute(Unknown Source)
> at
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
> Source)
>
> 
>
> --- Store code 
>
> Implementation odmg = OJB.getInstance();
> Database db = odmg.newDatabase();
>
> Lead leadBO = new Lead();
> leadBO.setFirstName("Eric");
> leadBO.setLastName("Northam");
> leadBO.setEmail("[EMAIL PROTECTED]");
>
> Notification notification = new Notification();
> notification.setName("Test notification");
>
> ArrayList notifications = new ArrayList();
> notifications.add(notification);
> leadBO.setNotifications(notifications);
>
> db.open(null, Database.OPEN_READ_WRITE);
>
> Transaction tx = odmg.newTransaction();
>
> tx.begin();
> tx.lock(leadBO, Transaction.WRITE);
> tx.commit();
>
> ---
>
> --- repository_user.xml ---
>
> 
>  jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
>  jdbc-type="VARCHAR"/>
>  jdbc-type="VARCHAR"/>
>  jdbc-type="VARCHAR"/>
>  element-class-ref="xxx.bo.Notification" auto-retrieve="true"
> auto-update="true" indirection-table="notification_lead">
> 
>  column="notification_id"/>
> 
> 
>
> 
>  jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
>  jdbc-type="VARCHAR"/>
>  jdbc-type="VARCHAR"/>
>  element-class-ref="xxx.bo.Lead" auto-retrieve="true" auto-update="true"
> indirection-table="notification_lead" >
>  column="notification_id"/>
> 
> 
> 
>
> ---
>
>
> TIA,
>
> Eric
>
> -Original Message-
> From: Mauricio CASTRO [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 4:12 PM
> To: OJB Users List
> Subject: Re: Non-decomposed m:n mappings with ODMG
>
>
> Eric,
>
> No, I use Postgesql. Try to post your repository_user.xml, and the source
> code that is supposed to do the work.
>
>
> Mauricio Castro.
>
> "Until they become conscious they will never rebel, and until after they
> have rebelled they cannot become conscious" --Orwell 1984
> - Original Message - 
> From: "Eric Northam" <[EMAIL PROTECTED]>
> To: "'OJB Users List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2003 3:12 PM
> Subject: RE: Non-decomposed m:n mappings with ODMG
>
>
> > You wouldn't happen to be using MySQL?
> >
> > -Original Message-
> > From: Mauricio CASTRO [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, June 10, 2003 4:06 PM
> > To: OJB Users List
> > Subject: Re: Non-decomposed m:n mappings with ODMG
> >
> >
> >
> > I succesfuly use an m:n mapping and ODMG.
> >
> > "Until they become conscious they will never rebel, and until after
> > they have rebelled they cannot become conscious" --Orwell 1984
> > - Original Message -
> > From: "Eric Northam" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 10, 2003 3:07 PM
> > Subject: Non-decomposed m:n mappings with ODMG
> >
> >
> > > Has anyone been able to store an object with an m:n mapping using
> > > the ODMG api? It works fine with the persistence broker but doesn't
> > > work with ODMG
> > as
> > > far as I can tell. Unfortunately I have several objects with a many
> > > to
> > many
> > > relationship so I'm wondering whether I should drop using the ODMG
> > > api all together. Is there any consequence to using both ODMG and
> > > the persistence broker together as a workaround?
> > >
> > > Eric
> > >
> > >
> > >
> > >
> > >
> > > DISCLAIMER: The information contained in this e-mail is, unless
> > > otherwise indicated, confidential and is intended solely for the use
> > > of the named addressee. Access, copying or re-use of the e-mail or
> > > any information contained therein by any other person is not
> > > authorized. If you are not
> > the
> > > intended recipient please notify us immediately by returning the
> > > e-mail to the originator.
> > >
> >
> > -

RE: Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Eric Northam
Sure thing,

The following causes a BatchUpdateException:

Invalid argument value,  message from server: "Duplicate entry '41' for key
1"
java.sql.BatchUpdateException: Invalid argument value,  message from server:
"Duplicate entry '41' for key 1

at
com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1367)
at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecut
e(Unknown Source)
at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
nknown Source)
at $Proxy0.doExecute(Unknown Source)
at org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
Source)

 

--- Store code 

Implementation odmg = OJB.getInstance();
Database db = odmg.newDatabase();

Lead leadBO = new Lead();
leadBO.setFirstName("Eric");
leadBO.setLastName("Northam");
leadBO.setEmail("[EMAIL PROTECTED]");

Notification notification = new Notification();
notification.setName("Test notification");

ArrayList notifications = new ArrayList();
notifications.add(notification);
leadBO.setNotifications(notifications);

db.open(null, Database.OPEN_READ_WRITE);

Transaction tx = odmg.newTransaction();

tx.begin();
tx.lock(leadBO, Transaction.WRITE);
tx.commit();

---

--- repository_user.xml ---





   
















---


TIA,

Eric

-Original Message-
From: Mauricio CASTRO [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 4:12 PM
To: OJB Users List
Subject: Re: Non-decomposed m:n mappings with ODMG


Eric,

No, I use Postgesql. Try to post your repository_user.xml, and the source
code that is supposed to do the work.


Mauricio Castro.

"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious" --Orwell 1984
- Original Message - 
From: "Eric Northam" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:12 PM
Subject: RE: Non-decomposed m:n mappings with ODMG


> You wouldn't happen to be using MySQL?
>
> -Original Message-
> From: Mauricio CASTRO [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 4:06 PM
> To: OJB Users List
> Subject: Re: Non-decomposed m:n mappings with ODMG
>
>
>
> I succesfuly use an m:n mapping and ODMG.
>
> "Until they become conscious they will never rebel, and until after 
> they have rebelled they cannot become conscious" --Orwell 1984
> - Original Message -
> From: "Eric Northam" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2003 3:07 PM
> Subject: Non-decomposed m:n mappings with ODMG
>
>
> > Has anyone been able to store an object with an m:n mapping using 
> > the ODMG api? It works fine with the persistence broker but doesn't 
> > work with ODMG
> as
> > far as I can tell. Unfortunately I have several objects with a many 
> > to
> many
> > relationship so I'm wondering whether I should drop using the ODMG 
> > api all together. Is there any consequence to using both ODMG and 
> > the persistence broker together as a workaround?
> >
> > Eric
> >
> >
> >
> >
> >
> > DISCLAIMER: The information contained in this e-mail is, unless 
> > otherwise indicated, confidential and is intended solely for the use 
> > of the named addressee. Access, copying or re-use of the e-mail or 
> > any information contained therein by any other person is not 
> > authorized. If you are not
> the
> > intended recipient please notify us immediately by returning the 
> > e-mail to the originator.
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> DISCLAIMER: The information contained in this e-mail is, unless 
> otherwise indicated, confidential and is intended solely for the use 
> of the named addressee. Access, copying or re-use of the e-mail or any 
> information contained therein by any other person is not authorized. 
> If you are not
the
> intended recipient please notify us immediately by returning the 
> e-mail to the originator.
>

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





DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any oth

Re: Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Mauricio CASTRO
Eric,

No, I use Postgesql. Try to post your repository_user.xml, and the source
code that is supposed to do the work.


Mauricio Castro.

"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious"
--Orwell 1984
- Original Message - 
From: "Eric Northam" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:12 PM
Subject: RE: Non-decomposed m:n mappings with ODMG


> You wouldn't happen to be using MySQL?
>
> -Original Message-
> From: Mauricio CASTRO [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 4:06 PM
> To: OJB Users List
> Subject: Re: Non-decomposed m:n mappings with ODMG
>
>
>
> I succesfuly use an m:n mapping and ODMG.
>
> "Until they become conscious they will never rebel, and until after they
> have rebelled they cannot become conscious" --Orwell 1984
> - Original Message - 
> From: "Eric Northam" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2003 3:07 PM
> Subject: Non-decomposed m:n mappings with ODMG
>
>
> > Has anyone been able to store an object with an m:n mapping using the
> > ODMG api? It works fine with the persistence broker but doesn't work
> > with ODMG
> as
> > far as I can tell. Unfortunately I have several objects with a many to
> many
> > relationship so I'm wondering whether I should drop using the ODMG api
> > all together. Is there any consequence to using both ODMG and the
> > persistence broker together as a workaround?
> >
> > Eric
> >
> >
> >
> >
> >
> > DISCLAIMER: The information contained in this e-mail is, unless
> > otherwise indicated, confidential and is intended solely for the use
> > of the named addressee. Access, copying or re-use of the e-mail or any
> > information contained therein by any other person is not authorized.
> > If you are not
> the
> > intended recipient please notify us immediately by returning the
> > e-mail to the originator.
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> DISCLAIMER: The information contained in this e-mail is, unless otherwise
> indicated, confidential and is intended solely for the use of the named
> addressee. Access, copying or re-use of the e-mail or any information
> contained therein by any other person is not authorized. If you are not
the
> intended recipient please notify us immediately by returning the e-mail to
> the originator.
>

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



RE: Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Eric Northam
You wouldn't happen to be using MySQL?

-Original Message-
From: Mauricio CASTRO [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 4:06 PM
To: OJB Users List
Subject: Re: Non-decomposed m:n mappings with ODMG



I succesfuly use an m:n mapping and ODMG.

"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious" --Orwell 1984
- Original Message - 
From: "Eric Northam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:07 PM
Subject: Non-decomposed m:n mappings with ODMG


> Has anyone been able to store an object with an m:n mapping using the 
> ODMG api? It works fine with the persistence broker but doesn't work 
> with ODMG
as
> far as I can tell. Unfortunately I have several objects with a many to
many
> relationship so I'm wondering whether I should drop using the ODMG api 
> all together. Is there any consequence to using both ODMG and the 
> persistence broker together as a workaround?
>
> Eric
>
>
>
>
>
> DISCLAIMER: The information contained in this e-mail is, unless 
> otherwise indicated, confidential and is intended solely for the use 
> of the named addressee. Access, copying or re-use of the e-mail or any 
> information contained therein by any other person is not authorized. 
> If you are not
the
> intended recipient please notify us immediately by returning the 
> e-mail to the originator.
>

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





DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorized. If you are not the
intended recipient please notify us immediately by returning the e-mail to
the originator.


Re: Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Mauricio CASTRO

I succesfuly use an m:n mapping and ODMG.

"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious"
--Orwell 1984
- Original Message - 
From: "Eric Northam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:07 PM
Subject: Non-decomposed m:n mappings with ODMG


> Has anyone been able to store an object with an m:n mapping using the ODMG
> api? It works fine with the persistence broker but doesn't work with ODMG
as
> far as I can tell. Unfortunately I have several objects with a many to
many
> relationship so I'm wondering whether I should drop using the ODMG api all
> together. Is there any consequence to using both ODMG and the persistence
> broker together as a workaround?
>
> Eric
>
>
>
>
>
> DISCLAIMER: The information contained in this e-mail is, unless otherwise
> indicated, confidential and is intended solely for the use of the named
> addressee. Access, copying or re-use of the e-mail or any information
> contained therein by any other person is not authorized. If you are not
the
> intended recipient please notify us immediately by returning the e-mail to
> the originator.
>

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



Non-decomposed m:n mappings with ODMG

2003-06-10 Thread Eric Northam
Has anyone been able to store an object with an m:n mapping using the ODMG
api? It works fine with the persistence broker but doesn't work with ODMG as
far as I can tell. Unfortunately I have several objects with a many to many
relationship so I'm wondering whether I should drop using the ODMG api all
together. Is there any consequence to using both ODMG and the persistence
broker together as a workaround?
 
Eric





DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorized. If you are not the
intended recipient please notify us immediately by returning the e-mail to
the originator.


Re: Some Problem about OJB]

2003-06-10 Thread Thomas Mahler
I agree with Carlos!

If you prefer to try an insert and to react on an exceptio in case of a
failure you can still do it with OJB:

just use
broker.store(object, ObjectModificationDefaultImpl.INSERT)

the ObjectModification parameter will tell OJB to use an INSERT without
prior checking!

cheers,
thomas

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



Multiple threads using one broker

2003-06-10 Thread Denis Avdic
Hi,

I am using OJB with Struts and I have a number of actions that use 
persistence broker calls to retrieve and store data.

Now, if I have a number of users using the application, all users share 
the same broker.  Thus I get collisions where one user would begin a 
transaction then another would begin a transaction (and get an 
exception) and then first user would commit transaction, and when the 
second user would try to commit transaction I get an error.

What can I do to fix this, is there anything in the configuration I can 
do, or does anyone have a trick for this?

my broker is a regular broker I get by calling 
PersistenceBrokerFactory.defaultPersistenceBroker();

TIA,

Denis

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


Re: Some Problem about OJB]

2003-06-10 Thread Edson Carlos Ericksson Richter
Hi!

Xiaxin, your are right at your point of view.

All the following text are IMHO:

In a OOP we always try to get objects before inserting and/or updating. Why?

1) Best end user experience. Users like when the app fill as many data as
possible;

2) Selects are always less "harmfull" to database then starting a
transaction, trying an insert/update, the rollbacking the transaction.

So, I always drive my users to work "query" oriented. Ask the system for
data you think is already there. For a small company, having 8 clients
in a table shows that almost all common clients will be there. I'll drive
the user to search in several ways for the right one before driving he to
put a new client on db.

Yes, I understand that are several approachs due to focus of your system.

But I think that OJB should not change their behavior...


Thanks for ear me.



Edson Richter


- Original Message - 
From: "Thomas Mahler" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:55 PM
Subject: [Fwd: Some Problem about OJB]




 Original Message 
Subject: Some Problem about OJB
Date: Wed, 11 Jun 2003 0:39:17 +0800
From: xiaxin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>

thma,hi:
OJB is a great project I had never seen in the world.
but a little problem? :-)

When I insert a record which maybe had already been inserted before. in
tradional way
the database will return a Exception such as "The primary Key constrain
violated ".

but in ojb, if I use store method, then the record will be updated if
already in database,
then , should I first query then go to store it ??

this way may be very inefficient.

Then how can I get rid off this inefficient?

Thanks a lot!


xiaxin
[EMAIL PROTECTED]
  2003-06-11





-
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.488 / Virus Database: 287 - Release Date: 5/6/2003



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



Re: Best Practices: Dates

2003-06-10 Thread Edson Carlos Ericksson Richter
You should declare

 


This should make things work (at least, WFM).


Edson Richter

- Original Message - 
From: "Aaron Longwell" <[EMAIL PROTECTED]>
To: "ObjectRelationalBridge User" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 3:28 PM
Subject: Best Practices: Dates


Goal: Retrieve a collection of objects with dates between X and Y

Current Implementation:

Event.java (Business Object) contains:
 java.util.Date startDate

repository.xml maps:
 

PB Query:
Criteria criteria = new Criteria();
criteria.addBetween("StartDate", startDate, endDate);
Query query = QueryFactory.newQuery(Event.class, criteria);

where startDate and endDate are java.util.Dates.

When this query executes, I receive no errors about converting from
TIMESTAMP to java.util.Date... and I DO receive results.  I receive
ONLY records where the StartDate column is -00-00 00:00:00... or
blank in other words. Why is it matching blank records when I am
attempting to find records between date X and date Y?

I get similar results when using the addGreaterOrEqualThan submitting
startDate. In this case I receive ALL records (including those with
-00-00 00:00:00).

If you'd rather ignore all the above... I'd like to see best practices
for using java.util.Dates with OJB (I'm using mySQL DateTime columns).

Thanks,
Aaron Longwell


-
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.488 / Virus Database: 287 - Release Date: 5/6/2003



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



Re: NullPointerException !

2003-06-10 Thread Lukas Severin
Thanks for the suggestion Thomas, here is the last DEBUG logging before the
NPE :

3297  DEBUG [Thread-4] metadata.RepositoryXmlHandler - <
field-descriptor
3297  DEBUG [Thread-4] metadata.RepositoryXmlHandler -   < class-descriptor
3297  DEBUG [Thread-4] metadata.RepositoryXmlHandler -  <
descriptor-repository
3313  DEBUG [Thread-4] metadata.RepositoryXmlHandler - endDoc
3313  INFO  [Thread-4] metadata.RepositoryPersistor - Read repository from
file took 735 ms
3313  INFO  [Thread-4] metadata.RepositoryPersistor - OJB Descriptor
Repository:
file:/C:/Program/Tomcat41/work/Standalone/localhost/pucken/WEB-INF/classes/repository.xml
3328  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler - 
startDoc   
3344  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler ->
jdbc-connection-descriptor
3359  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
jcd-alias: myConnection
3359  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
default-connection: true
3359  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
platform: MySQL
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
jdbc-level: 2.0
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
driver: com.mysql.jdbc.Driver
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
protocol: jdbc
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
subprotocol: mysql
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
dbalias: //localhost:3306/myDB
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
jndi-datasource-name: null
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
username: admin
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
password: blabla
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
eager-release: false
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
batch-mode: false
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
useAutoCommit: 1
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -
ignoreAutoCommitExceptions: false
3375  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler -<
jdbc-connection-descriptor
3391  DEBUG [Thread-4] metadata.ConnectionDescriptorXmlHandler - 
endDoc   
3422  DEBUG [Thread-4] metadata.ConnectionRepository - New descriptor was
added: [EMAIL PROTECTED]
  jcd-alias=myConnection
  default-connection=true
  dbms=MySQL
  jdbc-level=2.0
  driver=com.mysql.jdbc.Driver
  protocol=jdbc
  sub-protocol=mysql
  db-alias=//localhost:3306/myDB
  user=admin
  password=blabla
  eager-release=false
  ConnectionPoolDescriptor={whenExhaustedAction=0, maxIdle=-1, maxActive=21,
maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10,
testWhileIdle=false, minEvictableIdleTimeMillis=60, testOnReturn=false,
logAbandoned=false, removeAbandonedTimeout=300,
timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
  batchMode=false
  useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
  ignoreAutoCommitExceptions=false
  sequenceDescriptor=
]
3438  INFO  [Thread-4] metadata.RepositoryPersistor - Read connection
repository from file took 125 ms
3484  DEBUG [Thread-4] util.PropertyMessageResources -
getMessage(sv_SE,unhandledException)
3484  DEBUG [Thread-4] util.PropertyMessageResources - loadLocale(sv_SE)
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
'org/apache/struts/action/ActionResources_sv_SE.properties'
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
completed
3500  DEBUG [Thread-4] util.PropertyMessageResources - loadLocale(sv)
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
'org/apache/struts/action/ActionResources_sv.properties'
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
completed
3500  DEBUG [Thread-4] util.PropertyMessageResources - loadLocale()
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
'org/apache/struts/action/ActionResources.properties'
3500  DEBUG [Thread-4] util.PropertyMessageResources -   Loading resource
completed
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.configParse
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.destroyDataSource
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.sessionCreate
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.initDataSource
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.unhandledException
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.configMapping
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.initProcessor
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.applicationResources
3516  DEBUG [Thread-4] util.PropertyMessageResources -   Saving message key
'.applicationLoading
3516  D

Using Torque to generate repository.xml, etc...

2003-06-10 Thread Marcus Breese
I'm sorry if this has been covered before, a quick search yielded 
nothing, so I thought I'd just ask...

Is anyone out there using the build scripts included with torque to 
build the repository.xml file(s) and possibly associated classes?

I'm currently using them (somewhat modified) to build my object model 
classes and the repository, but I'm having some problems with getting 
it to build relationships (1:n, m:n, etc...).  I'm considering altering 
the Torque DTD to allow for explicit back-links (inverse 
relationships), but want to know if anyone else has already done this 
or is working on something similar.

Does anyone have any thoughts / suggestions?

-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese[EMAIL PROTECTED]
IU School of Medicine  [EMAIL PROTECTED]
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Fwd: Some Problem about OJB]

2003-06-10 Thread Thomas Mahler


 Original Message 
Subject: Some Problem about OJB
Date: Wed, 11 Jun 2003 0:39:17 +0800
From: xiaxin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>

thma,hi:
OJB is a great project I had never seen in the world.
but a little problem? :-)

When I insert a record which maybe had already been inserted before. in
tradional way
the database will return a Exception such as "The primary Key constrain
violated ".

but in ojb, if I use store method, then the record will be updated if
already in database,
then , should I first query then go to store it ??

this way may be very inefficient.

Then how can I get rid off this inefficient?

Thanks a lot!


xiaxin
[EMAIL PROTECTED]
  2003-06-11





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



Multiple Databases in one repository.xml?

2003-06-10 Thread David C. Hicks
From reading through the OJB documentation on repository.xml, I get the 
impression that it is possible to have connection pools to two different 
data sources in the same application, however I don't see any way to map 
which objects are persisted in which data source.  Has anyone ever tried 
this?  I actually do have a need to do this as I have a component that 
utilizes OJB for persistence that will be embedded in several 
applications.  One of these applications also uses OJB for persistence, 
but all applications need to share a common database for my component.

Thanks in advance for any input,
Dave


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


Re: encryption

2003-06-10 Thread Brian McCallister
On Tuesday, June 10, 2003, at 02:21 PM, David C. Hicks wrote:
I found when doing some encryption work earlier this year that 
Oracle's RAW column type was the right choice in order to store the 
data after encryption.  You also have to make sure that you provide 
enough space for any padding bytes that your encryption algorithm may 
add to the data.

I have base64 encoded encrypted data and plugged it into a TEXT for 
storage before, works nicely, and is friendly to deal with if you need 
to access it manually later. I haven't played with Oracle doing this, 
but we do it right now in Postgres and I cannot imagine it would be 
terribly different.

Doing it in a Field Conversion makes sense to me as that is exactly 
what it is - it just involves some data munging in addition to typical 
Database -> JDBC -> Java Object conversions.

If you need to maintain the ability to change keys/algorithms et, wrap 
the algorithm in a Strategy object dynamically loaded via reflection 
(OJB has lots of examples of this) and put the key in a properties 
object. It will take 15 more lines of code, but is infinitely more 
flexible.

-Brian

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


Best Practices: Dates

2003-06-10 Thread Aaron Longwell
Goal: Retrieve a collection of objects with dates between X and Y

Current Implementation:

Event.java (Business Object) contains:
java.util.Date startDate
repository.xml maps:


PB Query:
Criteria criteria = new Criteria();
criteria.addBetween("StartDate", startDate, endDate);
Query query = QueryFactory.newQuery(Event.class, criteria);
where startDate and endDate are java.util.Dates.

When this query executes, I receive no errors about converting from 
TIMESTAMP to java.util.Date... and I DO receive results.  I receive 
ONLY records where the StartDate column is -00-00 00:00:00... or 
blank in other words. Why is it matching blank records when I am 
attempting to find records between date X and date Y?

I get similar results when using the addGreaterOrEqualThan submitting 
startDate. In this case I receive ALL records (including those with 
-00-00 00:00:00).

If you'd rather ignore all the above... I'd like to see best practices 
for using java.util.Dates with OJB (I'm using mySQL DateTime columns).

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


Re: encryption

2003-06-10 Thread David C. Hicks
I would tend to agree with this.  It is highly unlikely that you'll 
change algorithms once your application is deployed.  It certainly 
doesn't make much sense to mix algorithms unless you're seriously 
paranoid.  Using a FieldConversion object also keeps your application 
developer (you may be the same person) from having to do the encryption 
work.  One possible drawback is that you may want to use different 
encryption keys for different fields.  Using a FieldConversion would 
make that more difficult.  Just something to think about.

I found when doing some encryption work earlier this year that Oracle's 
RAW column type was the right choice in order to store the data after 
encryption.  You also have to make sure that you provide enough space 
for any padding bytes that your encryption algorithm may add to the data.

Dave

Conall O'Raghallaigh wrote:

I would think separate converter classes the various algorithms, but I
haven't gotten far enough into it to know what makes the most sense.
-Conall

 

 



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


Re: encryption

2003-06-10 Thread Conall O'Raghallaigh
I would think separate converter classes the various algorithms, but I
haven't gotten far enough into it to know what makes the most sense.

-Conall

- Original Message -
From: "Jason McKerr" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 11:01 AM
Subject: Re: encryption


> I haven't tried it in a FieldConversion method. I just use a simple
> encrypt method for certain columns.
>
> Would you create a conversion method for different hashing algo's (i.e.
> one for SHA-1 and one for MD5) or make it a parameter somehow?
>
> Jason
>
>
> On Tue, 2003-06-10 at 10:56, Conall O'Raghallaigh wrote:
> > Hi,
> >
> > I'm using OJB with Oracle and have a requirement to encrypt certain
columns
> > in the database. I was thinking of doing the encryption/decryption work
in a
> > FieldConversion object. Does anyone have any experience/suggestions on
this?
> > Do you think it's a good idea to do this in the FieldConversion, or
should
> > it be kept completely out of the data access layer?
> >
> > Thanks for your help,
> >
> > Conall
> >
> >
> >
> > -
> > 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: encryption

2003-06-10 Thread Jason McKerr
I haven't tried it in a FieldConversion method. I just use a simple
encrypt method for certain columns.

Would you create a conversion method for different hashing algo's (i.e.
one for SHA-1 and one for MD5) or make it a parameter somehow?

Jason


On Tue, 2003-06-10 at 10:56, Conall O'Raghallaigh wrote:
> Hi,
> 
> I'm using OJB with Oracle and have a requirement to encrypt certain columns
> in the database. I was thinking of doing the encryption/decryption work in a
> FieldConversion object. Does anyone have any experience/suggestions on this?
> Do you think it's a good idea to do this in the FieldConversion, or should
> it be kept completely out of the data access layer?
> 
> Thanks for your help,
> 
> Conall
> 
> 
> 
> -
> 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]



encryption

2003-06-10 Thread Conall O'Raghallaigh
Hi,

I'm using OJB with Oracle and have a requirement to encrypt certain columns
in the database. I was thinking of doing the encryption/decryption work in a
FieldConversion object. Does anyone have any experience/suggestions on this?
Do you think it's a good idea to do this in the FieldConversion, or should
it be kept completely out of the data access layer?

Thanks for your help,

Conall



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



broker.getCount() and count(*)

2003-06-10 Thread Ricardo Tercero Lozano

Hello to all,

I know this question has been answered, but I could
not find it.

I want to execute a broker.getIteratorByQuery() and
to know the amount of elements returned by the query.
This is simple using broker.getCount().

But, how can I do it just to not to execute two queries,
one for the query itself and one for the count(*)?

thanks in advance,

--
--
Ricardo Tercero Lozano
iSOCO - Intelligent Software for the Networked Economy
e-mail: [EMAIL PROTECTED]
Web: http://www.isoco.com
Francisca Delgado 11, 2nd floor
28108 Alcobendas
Madrid (Spain)
#T: +34 91 334 9750
+34 91 334 9797 (Switchboard)
#F: +34 91 334 9799


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



RE: Forward engineering tool

2003-06-10 Thread Mahler Thomas
It's avalaible here:
http://cvs.apache.org/viewcvs/db-ojb/contrib/xdoclet-ojb-module.zip

> -Original Message-
> From: Jim McLaughlin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 5:32 PM
> To: OJB Users List; [EMAIL PROTECTED]
> Subject: RE: Forward engineering tool
> 
> 
> Is this DDL generator you discussed a while back in ...
> > Hi,
> >
> > I did not want to announce this before it is usable, but 
> since a lot of
> > folks asked for forward engineering and the dropped 
> forward-db stuff, I'd
> > just wanted to let you know that I'm currently working on an XDoclet
> > module for OJB that automatically generates the ojb repository file
> > (repository-user.xml) from java source files as well as a 
> corresponding
> > torque database schema, which can be used to automatically 
> instantiate the
> > database (sql, create-db and insert-sql targets in the 
> build-torque.xml
> > script). I expect to have it in a usable state sometime next week.
> >
> > Tom
> 
> Just asking?
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Friday, May 16, 2003 1:37 PM
> > To: Alexander Prozor
> > Cc: OJB Users List
> > Subject: Re: Forward engineering tool
> >
> >
> > Hi Alexander
> >
> > Alexander Prozor wrote:
> > > Hello Thomas,
> > >   sorry for writing you directly,
> > >   can you write me,
> > >   where should I looking for this tool?
> >
> > It does not yet exist. There are currently discussions how 
> to implement
> > it at:
> > http://nagoya.apache.org/wiki/apachewiki.cgi?OJBProjectPagesRevers
> > eEngineering
> >
> > There are also several existing solutions listed there.
> >
> >
> > >   or, if it doesn't exist - what did you used for O/R 
> mapping and DDL
> > >   generation?
> > >   Did you use Torque?
> > For the DDL Generation we use Torque. But the mappings for 
> the test bed
> > are created manually.
> >
> > For my job we have delevoped a cool XMI to Java, 
> repository.xml and DDL
> > generator. It's based on XSLT transformations. But it's 
> closed source...
> >
> > cheers,
> > Thomas
> >
> > >
> > >   thank you.
> > >
> > >
> >
> >
> > 
> -
> > 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: Multiple users, Connection Pool (related to FAQ)

2003-06-10 Thread Chris Halverson
"Armin Waibel" <[EMAIL PROTECTED]> writes:

> - setup one jdbc-connection-descriptor
>>   > jcd-alias="oracle"
>> default-connection="false"
>> protocol="jdbc"
>> subprotocol="oracle"
>> platform="Oracle"
>> driver="oracle.jdbc.driver.OracleDriver"
>> jdbc-level="2.0"
>> dbalias="thin:@host:1521:DB"
>> username=""
>> password=""
>>  />
> Say you have user 'guest' and user 'admin'.
> PBKey guestKey = new PBKey("oracle", "guest", "passwd1");
> PBKey adminKey = new PBKey("oracle", "admin", "passwd2");

Thanks for the quick response, here's a potential issue though.

OK, I can do that, no problem. However, I need to create these in an
authorization situation. I'm using SecurityFilter
(http://securityfilter.sf.net/) w/ Struts to do
authorization. SecurityFilter does this as a filter, so I don't have
access to the HttpRequest or anything. What I need to do is store the
resulting PB or PBKey or something useful into the connection manager
(or something). Then I could (I'm guessing) access that anywhere.

So I guess my real question is how and where can I save this
information? Do I need a custom connection manager? Does that even
matter here?

Does that make sense?

> Preconditioned it work for you, could you send me a short explanation
> of this in your own words to integrate in FAQ (maybe this will make
> it easier for the next user ;-)).

I can try :)

cdh

-- 
Chris D. Halverson http://www.halverson.org/

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



Materializing a single object that uses several database tables.

2003-06-10 Thread Cohen, Steve
Hi all,
We're starting to use OJB to replace hand coded SQL in some of our objects
now. Due to a flaky architecture, we have a 'User' object that maps to
several tables. Here is the schema:

BV_USER
USER_ID INTEGER
ACCOUNT_ID  INTEGER
USER_ALIAS  VARCHAR
PASSWORDVARCHAR

BV_USER_PROFILE
USER_ID INTEGER
FIRST_NAME  VARCHAR
EMAIL   VARCHAR
and about 50 more columns.


We have one object that encompasses both these tables (I'm not sure why
BroadVision designed the table structure like they did, but we have to live
with it). Is it possible to have OJB materialize this object with both the
password and email address intact?

I could probably do this with a reference descriptor pointing to an internal
class that would be exposed via a facade, but I really don't think that is
the cleanest way of handling it.
Any ideas?

By the way, we've done stress testing of OJB and deem it fit for production
on our site which has over 2 million users. Great work.



Steve   Cohen
Senior Software Developer
(216) 471-3824
[EMAIL PROTECTED]


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



RE: Problem retrieving class

2003-06-10 Thread Saman Ghodsian
Found the problem. After sleeping a couple of hours  :-/

The issue was that I defined dynamic proxy in my repository.xml so it
was retrieving a proxy instead of my own class.
Now I have to do some more reading on proxies..

Thanks for the replies

Sam



-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 1:32 AM
To: OJB Users List
Subject: Re: Problem retrieving class


Good morning Sam,

please could you post more info?
OJB version?
Example code (with select)?
class structure of Account?
stack trace?

We aren't clairvoyants. Maybe your
problem blow over after sleeping ;-)

regards,
Armin

- Original Message -
From: "Saman Ghodsian" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:57 AM
Subject: Problem retrieving class


> Hi there,
>
> It's late and I've been trying to do this for a while so I'll just
post
> this message hoping I get a reply in the morning
>
>
> I have a class structure, everything works fine when I store the
objects
> in DB, but after doing a select and trying to cast the object to my
type
> I get a classCastException
>
> i.e
>
> Account acc = (Account) result.get(0);
>
>
> Any ideas? Thanks
>
> Sam
>
>
> -
> 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: Multiple users, Connection Pool (related to FAQ)

2003-06-10 Thread Armin Waibel
Hi Chris,

as in the FAQ you have to possibilities:

- setup a jdbc-connection-descriptor for each
user (each with different jcd-alias name). you have
full control of used connection-pool and sequence-manager

- setup one jdbc-connection-descriptor
>jcd-alias="oracle"
> default-connection="false"
> protocol="jdbc"
> subprotocol="oracle"
> platform="Oracle"
> driver="oracle.jdbc.driver.OracleDriver"
> jdbc-level="2.0"
> dbalias="thin:@host:1521:DB"
> username=""
> password=""
>  />
Say you have user 'guest' and user 'admin'.
PBKey guestKey = new PBKey("oracle", "guest", "passwd1");
PBKey adminKey = new PBKey("oracle", "admin", "passwd2");

PersistenceBroker broker = PBF.createPersistenceBroker(guestKey);

use adminKey to lookup a PB instance for 'admin'.

This should work.
Preconditioned it work for you, could you send me
a short explanation of this in your own words to
integrate in FAQ (maybe this will make it easier
for the next user ;-)).

regards,
Armin

- Original Message -
From: "Chris Halverson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 4:57 PM
Subject: Multiple users, Connection Pool (related to FAQ)


> OK, I see this question in the FAQ, so I've done some research, so
> don't jump on me too badly :)
>
> Basically, I need to implement what is in the FAQ, multiple users
> connecting to the same database with different
> usernames/passwords. The FAQ says:
>
>  For it define one  jdbc-connection-descriptor , now you can use the
>  same jcdAlias  name with different User/Password . OJB copy  the
>  defined jdbc-connection-descriptor  and replace the username  and
>  password  with the given User/Password . Keep in mind, when the
>  connection-pool  element enables connection pooling, every user get
>  its separate pool. See How does OJB handle connection pooling .
>
> The connection pooling part doesn't give much information, or at least
> not enough that I'm figuring it out. For example, if I have a base
> connection-descriptor as:
>
>jcd-alias="oracle"
> default-connection="false"
> protocol="jdbc"
> subprotocol="oracle"
> platform="Oracle"
> driver="oracle.jdbc.driver.OracleDriver"
> jdbc-level="2.0"
> dbalias="thin:@host:1521:DB"
> username="username"
> password="password"
>  />
>
> How do I go about making this happen w/ different users? Do I have to
> create a new JdbcConnectionDescriptor setting the username and
> password? Then how do I get a PB out of this? Some real code would be
> helpful.
>
> Sorry if this is obvious, the docs make it sound like it is but I'm
> just not getting it. Thanks for any help!
>
> cdh
>
> --
> Chris D. Halverson http://www.halverson.org/
>
> -
> 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: Forward engineering tool

2003-06-10 Thread Jim McLaughlin
Is this DDL generator you discussed a while back in ...
> Hi,
>
> I did not want to announce this before it is usable, but since a lot of
> folks asked for forward engineering and the dropped forward-db stuff, I'd
> just wanted to let you know that I'm currently working on an XDoclet
> module for OJB that automatically generates the ojb repository file
> (repository-user.xml) from java source files as well as a corresponding
> torque database schema, which can be used to automatically instantiate the
> database (sql, create-db and insert-sql targets in the build-torque.xml
> script). I expect to have it in a usable state sometime next week.
>
> Tom

Just asking?

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 16, 2003 1:37 PM
> To: Alexander Prozor
> Cc: OJB Users List
> Subject: Re: Forward engineering tool
>
>
> Hi Alexander
>
> Alexander Prozor wrote:
> > Hello Thomas,
> >   sorry for writing you directly,
> >   can you write me,
> >   where should I looking for this tool?
>
> It does not yet exist. There are currently discussions how to implement
> it at:
> http://nagoya.apache.org/wiki/apachewiki.cgi?OJBProjectPagesRevers
> eEngineering
>
> There are also several existing solutions listed there.
>
>
> >   or, if it doesn't exist - what did you used for O/R mapping and DDL
> >   generation?
> >   Did you use Torque?
> For the DDL Generation we use Torque. But the mappings for the test bed
> are created manually.
>
> For my job we have delevoped a cool XMI to Java, repository.xml and DDL
> generator. It's based on XSLT transformations. But it's closed source...
>
> cheers,
> Thomas
>
> >
> >   thank you.
> >
> >
>
>
> -
> 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: Reversedb - a new problem?

2003-06-10 Thread Knost, Phillip
Is this a problem with Oracle?  I can easily reproduce the schema I need
classes for on SQL Server. 

-Original Message- 
From: Florian Bruckner [ mailto:[EMAIL PROTECTED]
 ] 
Sent: Tuesday, June 10, 2003 10:19 AM 
To: OJB Users List 
Subject: AW: Reversedb - a new problem? 


Hi Phil, 

> Using ojb 1.0 rc3, Oracle 9.2.0.1.0 and 9.2.0.1 JDBC driver, reversedb

> correctly reads the schema I want, and also generates what appears to 
> be valid XML for the repository.  However, when I try to generate 
> java, clicking on the Save button does nothing.  The save dialog just 
> sits there.  The only things that works is to cancel. 
> 
> I really don't want to have to manually code the classes for this 
> schema, as there are many tables.  Any suggestions? 

I fear there won't be a short term solution for your problem within
reversedb. What you can try is to generate Java classes from the your
respository descriptor with XSLT. I think someone posted a stylesheet on
the list which is doing exactly what you need.

regards, 

Florian 


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



RE: NullPointerException !

2003-06-10 Thread Mahler Thomas
I have only a guess:

>From you stacktrace we can see that there is a problem in the OjbExtent
constructor:
public OjbExtent(Class pClazz, PersistenceBroker pBroker)
{
clazz = pClazz;
Criteria selectExtent = null;
Query q = QueryFactory.newQuery(clazz, selectExtent);
broker = pBroker;
iterator = (RsIterator) broker.getIteratorByQuery(q);
}

The only place for a NPE is the last line.
So the problem seems to be that it was not possible to retieve a broker
instance.
This is usually an Indicator for problems with the repository.

Please try to set all log levels to DEBUG and try if you can see more
details.
It would also be could to use a servlet container debug environment 
(like WSAD with it's Tomcat testenvironment) to see what's going on...

cheers,
thomas

> -Original Message-
> From: Lukas Severin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 4:54 PM
> To: OJB Users List
> Subject: NullPointerException !
> 
> 
> Any ideas why I get this NullPointerException ?
> 
> - Original Message - 
> From: "Lukas Severin" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 10, 2003 1:05 PM
> Subject: NullPointerException in OjbExtent
> 
> 
> > I get the following exception running a JDO query in tomcat 
> (if I run it
> > standalone it works just fine) :
> > 
> > java.lang.NullPointerException
> > at org.apache.ojb.jdori.sql.OjbExtent.(Unknown Source)
> > at 
> org.apache.ojb.jdori.sql.OjbStoreManager.getExtent(Unknown
> > Source)
> > at 
> com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
> > Source
> > 
> > at 
> com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
> > Source)
> > at 
> com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
> > 
> > My query code :
> > PersistenceManagerFactory factory = new OjbStorePMF();
> > PersistenceManager pm = factory.getPersistenceManager();
> > Query q = null;
> > Collection c = null;
> > User user = null;
> > try {
> > String filter = "this.id == " +userId;
> > q = pm.newQuery(User.class, filter);
> > c = (Collection) q.execute();
> > user  = (User) c.iterator().next();
> > etc ...
> > 
> > 
> > 
> > My OJB.properties and repository files are in WEB-INF/classes.
> > 
> > Thanks for suggestions to solve this !
> > 
> > 
> > 
> -
> > 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]



Multiple users, Connection Pool (related to FAQ)

2003-06-10 Thread Chris Halverson
OK, I see this question in the FAQ, so I've done some research, so
don't jump on me too badly :)

Basically, I need to implement what is in the FAQ, multiple users
connecting to the same database with different
usernames/passwords. The FAQ says:

 For it define one  jdbc-connection-descriptor , now you can use the
 same jcdAlias  name with different User/Password . OJB copy  the
 defined jdbc-connection-descriptor  and replace the username  and
 password  with the given User/Password . Keep in mind, when the
 connection-pool  element enables connection pooling, every user get
 its separate pool. See How does OJB handle connection pooling .

The connection pooling part doesn't give much information, or at least
not enough that I'm figuring it out. For example, if I have a base
connection-descriptor as:

  

How do I go about making this happen w/ different users? Do I have to
create a new JdbcConnectionDescriptor setting the username and
password? Then how do I get a PB out of this? Some real code would be
helpful. 

Sorry if this is obvious, the docs make it sound like it is but I'm
just not getting it. Thanks for any help!

cdh

-- 
Chris D. Halverson http://www.halverson.org/

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



NullPointerException !

2003-06-10 Thread Lukas Severin
Any ideas why I get this NullPointerException ?

- Original Message - 
From: "Lukas Severin" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 1:05 PM
Subject: NullPointerException in OjbExtent


> I get the following exception running a JDO query in tomcat (if I run it
> standalone it works just fine) :
> 
> java.lang.NullPointerException
> at org.apache.ojb.jdori.sql.OjbExtent.(Unknown Source)
> at org.apache.ojb.jdori.sql.OjbStoreManager.getExtent(Unknown
> Source)
> at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
> Source
> 
> at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
> Source)
> at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
> 
> My query code :
> PersistenceManagerFactory factory = new OjbStorePMF();
> PersistenceManager pm = factory.getPersistenceManager();
> Query q = null;
> Collection c = null;
> User user = null;
> try {
> String filter = "this.id == " +userId;
> q = pm.newQuery(User.class, filter);
> c = (Collection) q.execute();
> user  = (User) c.iterator().next();
> etc ...
> 
> 
> 
> My OJB.properties and repository files are in WEB-INF/classes.
> 
> Thanks for suggestions to solve this !
> 
> 
> -
> 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]



AW: Reversedb - a new problem?

2003-06-10 Thread Florian Bruckner
Hi Phil,

> Using ojb 1.0 rc3, Oracle 9.2.0.1.0 and 9.2.0.1 JDBC driver, reversedb
> correctly reads the schema I want, and also generates what appears to be
> valid XML for the repository.  However, when I try to generate java,
> clicking on the Save button does nothing.  The save dialog just sits
> there.  The only things that works is to cancel.
>
> I really don't want to have to manually code the classes for this
> schema, as there are many tables.  Any suggestions?

I fear there won't be a short term solution for your problem within
reversedb. What you can try is to generate Java classes from the your
respository descriptor with XSLT. I think someone posted a stylesheet on the
list which is doing exactly what you need.

regards,

Florian


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



RE: storing maps

2003-06-10 Thread Mahler Thomas
Some references from the mailinglist archive:

http://search.gmane.org/search.php?query=HashMap&email=&group=gmane.comp.jak
arta.ojb.user&sort=date

http://article.gmane.org/gmane.comp.jakarta.ojb.user/6304/match=hashmap

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 3:47 PM
> To: OJB Users List
> Subject: storing maps
> 
> 
> Hello,
> 
> How can I proceed to store java Map objects ?
> 
> Thanks
> 
> -- 
> 
> -
> 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]



Réf. : storing maps

2003-06-10 Thread Nicolas . CHALUMEAU

I have le same problem, i want to known what is the syntax for my repository_usr.xml to init an hashtable attribut ?

I have 2 tables :
URLINFO {id_url, attribut1, ...}
OPTION {id_option, id_url, param_name, param_value}

With this informations I want to init a class with the following info : 
class URLInfo {
     int idUrl;
     String attribut;
     Hashtable options; // (key = param_name, value = param_value)
}

I think it is something like a reference-descriptor but I am newby with ODMG 

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

storing maps

2003-06-10 Thread [EMAIL PROTECTED]
Hello,

How can I proceed to store java Map objects ?

Thanks

-- 

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



Reversedb - a new problem?

2003-06-10 Thread Knost, Phillip
I'm relatively new to OJB, and I really like what I've seen of it so
far.  I searched the archives, but didn't see anyone have the same
problem with reversedb, so here goes:

Using ojb 1.0 rc3, Oracle 9.2.0.1.0 and 9.2.0.1 JDBC driver, reversedb
correctly reads the schema I want, and also generates what appears to be
valid XML for the repository.  However, when I try to generate java,
clicking on the Save button does nothing.  The save dialog just sits
there.  The only things that works is to cancel.

I really don't want to have to manually code the classes for this
schema, as there are many tables.  Any suggestions? 

Phil Knost 
Sr. DBA 
McKesson Information Solutions 



RE: 2 Questions about JDO in OJB

2003-06-10 Thread Leeuw van der, Tim



> 
> Yes, that's what I'm still recommending in the FAQ for production level
> applications.
> 

I currently used some commercial JDO implementations and we want, for the
moment, to move to using opensource-only.
I thought that I could do that with a 2-step approach: first switch to
OJB-JDO, then to 'native' OJB. Now I think that I should skip OJB-JDO
altogether and go directly to 'native' OJB.

> cheers,
> thomas

Thanks!

--Tim van der Leeuw


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



RE: 2 Questions about JDO in OJB

2003-06-10 Thread Mahler Thomas
Hi again,


> Hi Thomas,
> 
> For your answer to question 1: I was afraid of that. And 
> about question 2:
> the file 'tutorial4.jdo' has several tags  vendor-name="obj" ...
> />. Thus I was under the impression that several 
> vendor-extensions were
> already supported by OJB.

That's a bit misleading. At some point in time we already had experimental
support for JDO file with OJB specific vendor extensions, but we dropped it
for the time being. 

> 
> I guess I better focus on switching to the OBJ / ODMG API 
> proper for the
> moment!

Yes, that's what I'm still recommending in the FAQ for production level
applications.

cheers,
thomas

> Thanks,
> 
> --Tim van der Leeuw 
> 
> -Original Message-
> From: Mahler Thomas [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 10 juni 2003 13:27
> To: 'OJB Users List'
> Subject: RE: 2 Questions about JDO in OJB
> 
> 
> Hi Tim,
> 
> 
> > I have 2 questions about OJB's JDO:
> > - It's dependant on the SUN JDO-RI. To what extent does this 
> > impose a legal
> > problem for a commercial deployment of an application?
> 
> I'm not a lawyer. But if I understand the SUN JDO-RI licence 
> file correctly,
> you are not allowed to use it for a commercial deployment of 
> an application.
>  
> > - What vendor-extensions does it know in the metadata.jdo?
> 
> Currently none. the jdo file is needed for the enhancer only.
> All mapping information is still taken from OJB's repository.xml
> 
> > 
> > Regards,
> > 
> > --Tim van der Leeuw
> > 
> > 
> > 
> -
> > 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: 2 Questions about JDO in OJB

2003-06-10 Thread Leeuw van der, Tim
Hi Thomas,

For your answer to question 1: I was afraid of that. And about question 2:
the file 'tutorial4.jdo' has several tags . Thus I was under the impression that several vendor-extensions were
already supported by OJB.

I guess I better focus on switching to the OBJ / ODMG API proper for the
moment!

Thanks,

--Tim van der Leeuw 

-Original Message-
From: Mahler Thomas [mailto:[EMAIL PROTECTED]
Sent: dinsdag 10 juni 2003 13:27
To: 'OJB Users List'
Subject: RE: 2 Questions about JDO in OJB


Hi Tim,


> I have 2 questions about OJB's JDO:
> - It's dependant on the SUN JDO-RI. To what extent does this 
> impose a legal
> problem for a commercial deployment of an application?

I'm not a lawyer. But if I understand the SUN JDO-RI licence file correctly,
you are not allowed to use it for a commercial deployment of an application.
 
> - What vendor-extensions does it know in the metadata.jdo?

Currently none. the jdo file is needed for the enhancer only.
All mapping information is still taken from OJB's repository.xml

> 
> Regards,
> 
> --Tim van der Leeuw
> 
> 
> -
> 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: 2 Questions about JDO in OJB

2003-06-10 Thread Mahler Thomas
Hi Tim,


> I have 2 questions about OJB's JDO:
> - It's dependant on the SUN JDO-RI. To what extent does this 
> impose a legal
> problem for a commercial deployment of an application?

I'm not a lawyer. But if I understand the SUN JDO-RI licence file correctly,
you are not allowed to use it for a commercial deployment of an application.
 
> - What vendor-extensions does it know in the metadata.jdo?

Currently none. the jdo file is needed for the enhancer only.
All mapping information is still taken from OJB's repository.xml

> 
> Regards,
> 
> --Tim van der Leeuw
> 
> 
> -
> 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]



2 Questions about JDO in OJB

2003-06-10 Thread Leeuw van der, Tim
I have 2 questions about OJB's JDO:
- It's dependant on the SUN JDO-RI. To what extent does this impose a legal
problem for a commercial deployment of an application?

- What vendor-extensions does it know in the metadata.jdo?


Regards,

--Tim van der Leeuw


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



NullPointerException in OjbExtent

2003-06-10 Thread Lukas Severin
I get the following exception running a JDO query in tomcat (if I run it
standalone it works just fine) :

java.lang.NullPointerException
at org.apache.ojb.jdori.sql.OjbExtent.(Unknown Source)
at org.apache.ojb.jdori.sql.OjbStoreManager.getExtent(Unknown
Source)
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
Source

at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
Source)
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)

My query code :
PersistenceManagerFactory factory = new OjbStorePMF();
PersistenceManager pm = factory.getPersistenceManager();
Query q = null;
Collection c = null;
User user = null;
try {
String filter = "this.id == " +userId;
q = pm.newQuery(User.class, filter);
c = (Collection) q.execute();
user  = (User) c.iterator().next();
etc ...



My OJB.properties and repository files are in WEB-INF/classes.

Thanks for suggestions to solve this !


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



Re: Problem retrieving class

2003-06-10 Thread Alen Ribic
oops.
Sorry everyone.
I didn't read the TO address. I thought it was struts mailing list. (I guess
I didn't read the post well either)

excuse my previous post. :)
--Alen


- Original Message -
From: "Saman Ghodsian" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:57 AM
Subject: Problem retrieving class


> Hi there,
>
> It's late and I've been trying to do this for a while so I'll just post
> this message hoping I get a reply in the morning
>
>
> I have a class structure, everything works fine when I store the objects
> in DB, but after doing a select and trying to cast the object to my type
> I get a classCastException
>
> i.e
>
> Account acc = (Account) result.get(0);
>
>
> Any ideas? Thanks
>
> Sam
>
>
> -
> 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: Problem retrieving class

2003-06-10 Thread Alen Ribic
I've got the same problem on this one.
I get the exception in the tag 

Would love to now how to over come it.
I haven't look at it since last night but I will get a chance sometime
today. (maybe I'll find out what the problem is, myself :))

--Alen


- Original Message -
From: "Saman Ghodsian" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:57 AM
Subject: Problem retrieving class


> Hi there,
>
> It's late and I've been trying to do this for a while so I'll just post
> this message hoping I get a reply in the morning
>
>
> I have a class structure, everything works fine when I store the objects
> in DB, but after doing a select and trying to cast the object to my type
> I get a classCastException
>
> i.e
>
> Account acc = (Account) result.get(0);
>
>
> Any ideas? Thanks
>
> Sam
>
>
> -
> 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: Problem retrieving class

2003-06-10 Thread Armin Waibel
Good morning Sam,

please could you post more info?
OJB version?
Example code (with select)?
class structure of Account?
stack trace?

We aren't clairvoyants. Maybe your
problem blow over after sleeping ;-)

regards,
Armin

- Original Message -
From: "Saman Ghodsian" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:57 AM
Subject: Problem retrieving class


> Hi there,
>
> It's late and I've been trying to do this for a while so I'll just
post
> this message hoping I get a reply in the morning
>
>
> I have a class structure, everything works fine when I store the
objects
> in DB, but after doing a select and trying to cast the object to my
type
> I get a classCastException
>
> i.e
>
> Account acc = (Account) result.get(0);
>
>
> Any ideas? Thanks
>
> Sam
>
>
> -
> 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]



Problem retrieving class

2003-06-10 Thread Saman Ghodsian
Hi there,

It's late and I've been trying to do this for a while so I'll just post
this message hoping I get a reply in the morning


I have a class structure, everything works fine when I store the objects
in DB, but after doing a select and trying to cast the object to my type
I get a classCastException

i.e 

Account acc = (Account) result.get(0);


Any ideas? Thanks 

Sam


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