You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Beer, Christian" <Ch...@Diron.DE> on 2003/05/28 16:43:51 UTC
[jxpath] Iterating using "a/b//c//d[type='e']"...
Hello!
While evaluating JXPath if it could be used in my project, I got the
following problem:
I have a very complicated object tree that can get very big. It consists of
the following classes:
MyObject (super-class of the following)
MyArray
MyName
MyDictionary
MyBoolean
MyString
MyInteger
MyReal
MyNull
MyReference
Rules:
- There is one root MyDictionary.
- all but MyArray and MyDictionary are leaf-nodes.
- Keys to the dictionarys are allways MyName objects.
- I created a MyDictionaryHandler that gives the keys as strings to jxpath.
- MyReference contains references to objects.
- My MyDictionary and MyArray resolve this references and return the real
objects in get and iterator.
- Sometimes there are items in MyDictionary called parent, that contain a
reference on the parent-My-Object.
The tree would look quite complex, so I'll skip it.
If I call, for example "myContext.iterate("a/b//c//d[t='f']")" on a quite
big tree, my program hangs.
Does anyone have an idea? Is it a loop in my tree? Is there a known bug in
JXPath?
I know it is quite complicated but I hope you can help me!
Thanks in advance,
Christian Beer
[DBCP] sample usage questions
Posted by Keith Veleba <ke...@veleba.net>.
Hello,
I'm currently in the process of retrofitting an application that
contains some database connection pooling. Unfortunately, scalability
issues with the current custom pooling implementation have cropped up,
forcing a rewrite of those pools. In my search, I discovered the DBCP
and decided to use it to implement more robust pools in our application.
However, I have a question that I'm hoping someone can answer.
1) My application calls for a number of pools to be created to
different databases. I would like to know how best to use the objects
provided. Currently, our pooling is implemented using the Singleton
design pattern; I would like to create a version of that class which
uses the DBCP for pooling, and not our homegrown pooling code.
In the manual pooling example shown, the pool consists of the following
objects:
ObjectPool connectionPool = new GenericObjectPool(null);
ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory(connectURI,null);
PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory(connectionFactory,connectionPool,null,null,fal
se,true);
PoolingDriver driver = new PoolingDriver();
driver.registerPool("example",connectionPool);
I would assume from this example that for any number of pools, I would
need instances of the following:
1 ObjectPool, ConnectionFactory, and PoolableConnectionFactory for each
database connection pool
1 PoolingDriver for all connection pools.
Is this essentially correct?
Thanks,
Keith Veleba
<ke...@veleba.net>
DBCP sample usage questions
Posted by Keith Veleba <ke...@veleba.net>.
Hello,
I'm currently in the process of retrofitting an application that
contains some database connection pooling. Unfortunately, scalability
issues with the current custom pooling implementation have cropped up,
forcing a rewrite of those pools. In my search, I discovered the DBCP
and decided to use it to implement more robust pools in our application.
However, I have a question that I'm hoping someone can answer.
1) My application calls for a number of pools to be created to
different databases. I would like to know how best to use the objects
provided. Currently, our pooling is implemented using the Singleton
design pattern; I would like to create a version of that class which
uses the DBCP for pooling, and not our homegrown pooling code.
In the manual pooling example shown, the pool consists of the following
objects:
ObjectPool connectionPool = new GenericObjectPool(null);
ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory(connectURI,null);
PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory(connectionFactory,connectionPool,null,null,fal
se,true);
PoolingDriver driver = new PoolingDriver();
driver.registerPool("example",connectionPool);
I would assume from this example that for any number of pools, I would
need instances of the following:
1 ObjectPool, ConnectionFactory, and PoolableConnectionFactory for each
database connection pool
1 PoolingDriver for all connection pools.
Is this essentially correct?
Thanks,
Keith Veleba
<ke...@veleba.net>
Re: [jxpath] Iterating using "a/b//c//d[type='e']"...
Posted by Dmitri Plotnikov <dp...@yahoo.com>.
Christian,
It's very important that you use the current nightly build. There is a
check for loops in the graph. However, I don't think it is a 100%
guarantee against infinite loops. If the upgrade to the current build
does not solve the problem, let me know - we'll have to investigate
further.
- Dmitri
--- "Beer, Christian" <Ch...@Diron.DE> wrote:
> Hello!
>
> While evaluating JXPath if it could be used in my project, I got the
> following problem:
>
> I have a very complicated object tree that can get very big. It
> consists of
> the following classes:
>
> MyObject (super-class of the following)
> MyArray
> MyName
> MyDictionary
> MyBoolean
> MyString
> MyInteger
> MyReal
> MyNull
> MyReference
>
> Rules:
> - There is one root MyDictionary.
> - all but MyArray and MyDictionary are leaf-nodes.
> - Keys to the dictionarys are allways MyName objects.
> - I created a MyDictionaryHandler that gives the keys as strings to
> jxpath.
> - MyReference contains references to objects.
> - My MyDictionary and MyArray resolve this references and return the
> real
> objects in get and iterator.
> - Sometimes there are items in MyDictionary called parent, that
> contain a
> reference on the parent-My-Object.
>
> The tree would look quite complex, so I'll skip it.
>
> If I call, for example "myContext.iterate("a/b//c//d[t='f']")" on a
> quite
> big tree, my program hangs.
>
> Does anyone have an idea? Is it a loop in my tree? Is there a known
> bug in
> JXPath?
>
>
> I know it is quite complicated but I hope you can help me!
>
> Thanks in advance,
>
> Christian Beer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com