Re: Incorrect or not found field reference name

2006-09-21 Thread Kamal Bhatt

NM.

Worked it out. The reference-descriptor was pointing to the column 
heading instead of the id.


Cheers.

--
Kamal Bhatt


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



Dynamic SQL without use of PreparedStatement

2006-09-21 Thread Berner Martin
Hy
Dos anybody know how to use the benefit of OJB (creating dynamic SQL whit 
Criteria and Reportquerry), but not to use PreparedStatements which uses 
Bindvariables?

Thanks for any help
Martin Berner


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



Re: Problem with simple report query

2006-09-21 Thread Armin Waibel

Hi Aaron,

 I want to perform a report query for the ids of VersionBeans that
 reference namespaces with a given namespace value.  I've tried this:

 ===[BEGIN Query #1]===
Criteria c = new Criteria();
c.addGreaterOrEqualThan(id, new Integer(1));
c.addEqualTo(_namespace.namespace, NS);

ReportQueryByCriteria query =
 QueryFactory.newReportQuery(VersionBean.class, c);
query.setAttributes(new String[] {id});

Iterator i = broker.getReportQueryIteratorByQuery(query);
 ===[END Query #1]===

I don't have problems to perform a similar report query (with latest 
from SVN OJB_1_0_RELEASE branch).
Think the problem is that you use the column names instead of the field 
names (the Criteria query api is java field base, try to avoid column 
names in queries), please replace id with _id and try again.


regards,
Armin


Aaron Dixon wrote:

I have two OJB classes, VersionBean and Namespace.  VersionBean has a
foreign key reference to a namespace; it's fields are:

===[BEGIN VersionBean.java]===
...
   /**
* @ojb.field column=id
*primarykey=true
*/
   private Integer _id;

   /**
* @ojb.field column=value
*/
   private String _value;

   /**
* @ojb.field column=namespaceId
*nullable=true
*/
   private Integer _namespaceId;

   /**
* @ojb.reference
*  auto-update=none
*  auto-delete=false
*  class-ref=com.webify.prototype.domain.Namespace
*  foreignkey=_namespaceId
*/
   private Namespace _namespace;
...
===[END VersionBean.java]===

Namespace fields are like so:

===[BEING Namespace.java]===
...
   /**
* @ojb.field column=id
*primarykey=true
*autoincrement=ojb
*/
   private Integer _id;

   /**
* @ojb.field column=namespace
*/
   private String _namespace;
...
===[END Namespace.java]===

I want to perform a report query for the ids of VersionBeans that
reference namespaces with a given namespace value.  I've tried this:

===[BEGIN Query #1]===
   Criteria c = new Criteria();
   c.addGreaterOrEqualThan(id, new Integer(1));
   c.addEqualTo(_namespace.namespace, NS);

   ReportQueryByCriteria query =
QueryFactory.newReportQuery(VersionBean.class, c);
   query.setAttributes(new String[] {id});

   Iterator i = broker.getReportQueryIteratorByQuery(query);
===[END Query #1]===

I get the following exception when this code executes:

===[BEGIN error from Query #1]===
org.apache.ojb.broker.PersistenceBrokerSQLException:
* Can't prepare statement:
* sql statement was 'SELECT id FROM p_version A0 INNER JOIN
p_namespace A1 ON A0.namespaceId=A1.id WHERE (id = ?) AND namespace =
?'
* Exception message is [Column name 'ID' is in more than one table in
the FROM list.]
* Vendor error code [3]
* SQL state code [42X03]
at 
org.apache.ojb.broker.util.ExceptionHelper.generateException(ExceptionHelper.java:256) 


... (full stack at bottom of this email message)
===[END error from Query #1]===

As I understand this, I need to disambiguate the id attribute using 
aliases:


===[BEGIN Query #2]===
   Criteria c = new Criteria();
   c.setAlias(VER);
   c.addGreaterOrEqualThan(id, new Integer(1));
   c.addEqualTo(_namespace.namespace, NS);

   ReportQueryByCriteria query =
QueryFactory.newReportQuery(VersionBean.class, c);
   query.setAttributes(new String[] {VER.id});

   Iterator i = broker.getReportQueryIteratorByQuery(query);
===[END Query #2]===

===[BEGIN error from Query #2]===
[org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR:
* Can't prepare statement:
* sql statement was 'SELECT VER.id FROM p_version A0 INNER JOIN
p_namespace A1 ON A0.namespaceId=A1.id WHERE (id = ?) AND namespace =
?'
* Exception message is [Column 'VER.ID' is either not in any table in
the FROM list or appears within a join specification and is outside
the scope of the join specification or appears in a HAVING clause and
is not in the GROUP BY list. If this is a CREATE or ALTER TABLE
statement then 'VER.ID' is not a column in the target table.]
* Vendor error code [3]
* SQL state code [42X04]
* The root stack trace is --
* ERROR 42X04: Column 'VER.ID' is either not in any table in the FROM
list or appears within a join specification and is outside the scope
of the join specification or appears in a HAVING clause and is not in
the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then
'VER.ID' is not a column in the target table.
at 
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)

... (full stack at bottom of this email message)
===[END error from Query #2]===

Which of the APIs am I misunderstanding?

Thanks,
Aaron


Full error stacks for reference:


===[BEGIN error from Query #1]===
org.apache.ojb.broker.PersistenceBrokerSQLException:
* Can't prepare statement:
* sql statement was 'SELECT id FROM p_version A0 INNER JOIN
p_namespace A1 ON 

Re: Dynamic SQL without use of PreparedStatement

2006-09-21 Thread Armin Waibel

Hi Martin,

Berner Martin wrote:

Hy
Dos anybody know how to use the benefit of OJB (creating dynamic SQL whit 
Criteria and Reportquerry), but not to use PreparedStatements which uses 
Bindvariables?



Think this not possible. OJB always use PreparedStatements to perform 
Criteria based queries.


regards,
Armin


Thanks for any help
Martin Berner


-
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: removal aware list

2006-09-21 Thread Armin Waibel

Hi Dennis,

Dennis Bekkering wrote:

Richter,

I use 1.04 and explicitly configured ojb not to use a RemovalAwareList. I
explicitly configured ojb to use a ManageableArrayList. But still i get a
RemovalAwareList out of the proxy class's getData method.



I tried to reproduce your test (m:n reference + proxy) without success - 
I always get a ManageableArrayList instance. I'm using latest from SVN 
(OJB_1_0_RELEASE branch).

Could you exactly describe how to reproduce your problem.

regards,
Armin



regards,
Dennis

2006/9/19, Edson Carlos Ericksson Richter 
[EMAIL PROTECTED]:


As name said, it's a Removal Aware. If you don't wish objects removed,
don't use RemovarAware. The default implementation is not
RemovalAwareList, so it's sufficient to remove the specific
implementation on mapping.

IT: some older versions of OJB used RemovalAwareList as default - so,
please, if you are not using 1.0.3 or 1.0.4, upgrade your version (check
mail list about changes that could affect your upgrade).

Regards,

Richter



Dennis Bekkering escreveu:
 Hello all,

 I have an M:N collection that has a ManageableArrayList as collection
 class
 and proxy set to true. But when the collection is materialized the
 underlying implementation becomes RemovalAwareList. When i remove
 items from
 that list the records are also deleted. I tried to find out how that 
can

 happen with the debugger but i cannot find out why.

 regards,
 Dennis





-
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: TxCheck, JTA and Spring

2006-09-21 Thread Armin Waibel

Hi Mike,

Mike Perham wrote:

We are using Spring and JTA in container to manage transactional DAOs.
We have TxCheck enabled and when one of our transactional DAOs is
called in JBoss, we get a No running tx found... message.

Should we disable the TxCheck since we are not using PB transactions
or does TxCheck handle this case and we just have something
misconfigured?



You can disable the check in OJB.properties and go on without using
PB-tx demarcation, but in this case you should take care of side-effects
- e.g. you can't use the two-level cache (because the cache can't
synchronize with PB-tx demarcation). I would recommend
ObjectCachePerBroker or the two-level cache with an empty ObjectCache.
Don't forget to immediately close PB instances after use, only in this 
case OJB can do internal cleanup.


regards,
Armin



-
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: removal aware list

2006-09-21 Thread Edson Carlos Ericksson Richter
Yes, I have a system with about 600 entities, several are M:N, and all 
are proxies.

I can't reproduce either.
I'm using 1.0.3.

Regards,

Richter


Armin Waibel escreveu:

Hi Dennis,

Dennis Bekkering wrote:

Richter,

I use 1.04 and explicitly configured ojb not to use a 
RemovalAwareList. I
explicitly configured ojb to use a ManageableArrayList. But still i 
get a

RemovalAwareList out of the proxy class's getData method.



I tried to reproduce your test (m:n reference + proxy) without success 
- I always get a ManageableArrayList instance. I'm using latest from 
SVN (OJB_1_0_RELEASE branch).

Could you exactly describe how to reproduce your problem.

regards,
Armin



regards,
Dennis

2006/9/19, Edson Carlos Ericksson Richter 
[EMAIL PROTECTED]:


As name said, it's a Removal Aware. If you don't wish objects 
removed,

don't use RemovarAware. The default implementation is not
RemovalAwareList, so it's sufficient to remove the specific
implementation on mapping.

IT: some older versions of OJB used RemovalAwareList as default - so,
please, if you are not using 1.0.3 or 1.0.4, upgrade your version 
(check

mail list about changes that could affect your upgrade).

Regards,

Richter



Dennis Bekkering escreveu:
 Hello all,

 I have an M:N collection that has a ManageableArrayList as collection
 class
 and proxy set to true. But when the collection is materialized the
 underlying implementation becomes RemovalAwareList. When i remove
 items from
 that list the records are also deleted. I tried to find out how 
that can

 happen with the debugger but i cannot find out why.

 regards,
 Dennis





-
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: OJB-DBCP initial connection pool setting support

2006-09-21 Thread Armin Waibel

Hi Eric,

Ferrer, Eric wrote:

Hi,

 


DBCP supports an initialSize property for initializing connections on
startup, does OJB support this parameter?



A DBCP property 'initialSize' is not supported. Could you point me at 
the DBCP doc-section describe this property?


regards,
Armin


 


Thanks

-Eric

 

 

Disclaimer: 
This email may contain confidential and privileged material for the sole use of the intended recipient(s) and only for those purposes previously or herein authorized by the sender. Any review, use, distribution or disclosure by others, or use by the recipient for unauthorized purposes, is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.




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



RE: OJB-DBCP initial connection pool setting support

2006-09-21 Thread Ferrer, Eric
Sure Armin,

http://jakarta.apache.org/commons/dbcp/configuration.html

parameter initialSize added since 1.2 version of jar.

I am trying to setup a case where x connections are in the pool per
number of users, setup the maxActive to expected load, setup some
eviction threads and test that after peak usage increase our connection
pools to maxActive threshold, that when eviction threads run, we come
back down to our original pool settings.  

I may have to use JBoss to accomplish this, but my code base supports
Tomcat and Jboss in production using DBCP and I would like to keep this
the same.

Thanks
-Eric

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 1:30 PM
To: OJB Users List
Subject: Re: OJB-DBCP initial connection pool setting support

Hi Eric,

Ferrer, Eric wrote:
 Hi,
 
  
 
 DBCP supports an initialSize property for initializing connections on
 startup, does OJB support this parameter?
 

A DBCP property 'initialSize' is not supported. Could you point me at 
the DBCP doc-section describe this property?

regards,
Armin


  
 
 Thanks
 
 -Eric
 
  
 
  
 
 Disclaimer: 
 This email may contain confidential and privileged material for the
sole use of the intended recipient(s) and only for those purposes
previously or herein authorized by the sender. Any review, use,
distribution or disclosure by others, or use by the recipient for
unauthorized purposes, is strictly prohibited. If you are not the
intended recipient (or authorized to receive for the recipient), please
contact the sender by reply email and delete all copies of this message.
 

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

Disclaimer: 
This email may contain confidential and privileged material for the sole use of 
the intended recipient(s) and only for those purposes previously or herein 
authorized by the sender. Any review, use, distribution or disclosure by 
others, or use by the recipient for unauthorized purposes, is strictly 
prohibited. If you are not the intended recipient (or authorized to receive for 
the recipient), please contact the sender by reply email and delete all copies 
of this message.

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



Re: removal aware list

2006-09-21 Thread Dennis Bekkering

I tried to reproduce your test (m:n reference + proxy) without success -
I always get a ManageableArrayList instance. I'm using latest from SVN
(OJB_1_0_RELEASE branch).
Could you exactly describe how to reproduce your problem.

regards,
Armin


While describing i found out that there was another M:N collection
that did not specified the collection class. While stepping i thought
it was the other, thanks and sorry to have bothered you with this
because nothing is wrong.

Cheers,
Dennis

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