<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>ojb-user@db.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/db-ojb-user/</id>
<updated>2009-12-06T21:26:00Z</updated>
<entry>
<title>Mandragora 0.3.4</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200911.mbox/%3c59f42c000911112337x7648c66bmb7ff05a67ed07147@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000911112337x7648c66bmb7ff05a67ed07147@mail-gmail-com%3e</id>
<updated>2009-11-12T07:37:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

mandragora-0.3.4 has been released.
You can find it here http://mandragora.sourceforge.net/download.html

It has been integrated with Spring.
Now you can use the dependency injection in place of Service Locator Service
to link Bd, ServiceFacade, ApplicationService and Dao.

Moreover there is a new implementation of the Ojb DAO made using AOP .
Right now there ir no documentation about this, but you can have a look a
the examples if you download the sources, or have a look at the CVS
repository.

Best regards
Alessandro


</pre>
</div>
</content>
</entry>
<entry>
<title>Query by Criteria</title>
<author><name>Kevin Roll &lt;kroll@appropel.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200907.mbox/%3c73631BE4-47F5-436F-9DAA-469179455249@appropel.com%3e"/>
<id>urn:uuid:%3c73631BE4-47F5-436F-9DAA-469179455249@appropel-com%3e</id>
<updated>2009-07-01T14:54:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Two questions regarding OJB:

1. Can the Query by Criteria API be used in conjunction with an  
existing JDO application? I merely want to gain the query by criteria  
function, I don't want to change the rest of my app.
2. Is OJB under active development?

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Future development</title>
<author><name>Ilkka Priha &lt;ipriha@norther.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200906.mbox/%3c4A3097EB.10208@norther.org%3e"/>
<id>urn:uuid:%3c4A3097EB-10208@norther-org%3e</id>
<updated>2009-06-11T05:36:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
We prefer OJB:s compact size, explicit control of caching, clear 
structure and functionality, and especially the ability to dynamically 
modify the persistence model through the API during run-time without 
disturbing open sessions; Hibernate lacks most of these features and JPA 
is too limited. We haven't yet tried JDO, I understood that it provides 
more than JPA.

-- Ilkka

Jason wrote:
&gt; I think Hibernate sucked all the air out of the room. The number of tools
&gt; offering hibernate integration has been outpacing OJB forever.
&gt; Are there any compelling features in OJB that are not found elsewhere?
&gt; 
&gt;  - Jason
&gt; 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Future development</title>
<author><name>Jason &lt;jason.lunn@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200906.mbox/%3c7d1fa50d0906101457o3fa2ac02r4cdcd690bf5ba592@mail.gmail.com%3e"/>
<id>urn:uuid:%3c7d1fa50d0906101457o3fa2ac02r4cdcd690bf5ba592@mail-gmail-com%3e</id>
<updated>2009-06-10T21:57:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I think Hibernate sucked all the air out of the room. The number of tools
offering hibernate integration has been outpacing OJB forever.
Are there any compelling features in OJB that are not found elsewhere?

 - Jason


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Future development</title>
<author><name>&quot;Janssen, Roger&quot; &lt;roger.janssen@ibanx.nl&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200906.mbox/%3c2D4F9F8D30B7A847BEF849316269A3A501247A62@VERONA.kantoor.ibanx.nl%3e"/>
<id>urn:uuid:%3c2D4F9F8D30B7A847BEF849316269A3A501247A62@VERONA-kantoor-ibanx-nl%3e</id>
<updated>2009-06-10T21:48:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I am wondering the same thing. I believe a year ago, their was one
really active developer (Armin), but he turned papa and did not have
much time between work and fatherhood. He managed to squeeze out a
release candidate for a maintenance release (eagerly awaited for more
then two years), but there were regression issues with it. That was the
last I really heard about any OJB development.

If you look at the mailinglist archive, you will notice that for the
past half a year maybe 50 messages have been sent, so their is no real
active community anymore either.

We are still using OJB (1.0-rc5) but are also deliberating a move to
something else, like hibernate or the new upcoming JPA.

Kind regards,

Roger Janssen
ibanx

-----Original Message-----
From: Paul Joseph [mailto:pjoseph@gmail.com] 
Sent: Wednesday, June 10, 2009 9:18 PM
To: OJB Users List
Subject: Re: Future development

Good question--I asked the list a question about a month ago when I ran
into problems trying to get the OJB-JDO bridge working on Vista, but
there was no reply.

John Eichelsdorfer wrote:
&gt; Is there an active developer still on this project?  Though it would 
&gt; take a large amount of effort, we are wondering if over time we should

&gt; move towards a different bridge technology.  We were not able to get 
&gt; some of the newer features to work with the 1.0.5 beta mentioned in a 
&gt; former letter and are not sure if the beta is even coming out still.  
&gt; Just trying to manage our risk and planning.
&gt;
&gt; Regards,
&gt;
&gt; JohnE
&gt;
&gt;
&gt; -----
&gt; John Eichelsdorfer
&gt;
&gt; http://jobbank.com/ jobbank.com
&gt;   

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org 
 
************************************************************************* 
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication
without the authority of iBanx bv. iBanx bv is neither liable for the
proper and complete transmission of the information has been maintained
nor that the communication is free of viruses, interceptions or
interference.  
 
If you are not the intended recipient of this communication please return
the communication to the sender and delete and destroy all copies.  





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Future development</title>
<author><name>Paul Joseph &lt;pjoseph@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200906.mbox/%3c4A3006E1.4050500@gmail.com%3e"/>
<id>urn:uuid:%3c4A3006E1-4050500@gmail-com%3e</id>
<updated>2009-06-10T19:17:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Good question--I asked the list a question about a month ago when I ran 
into problems trying to get the OJB-JDO bridge working on Vista, but 
there was no reply.

John Eichelsdorfer wrote:
&gt; Is there an active developer still on this project?  Though it would take a
&gt; large amount of effort, we are wondering if over time we should move towards
&gt; a different bridge technology.  We were not able to get some of the newer
&gt; features to work with the 1.0.5 beta mentioned in a former letter and are
&gt; not sure if the beta is even coming out still.  Just trying to manage our
&gt; risk and planning.
&gt;
&gt; Regards,
&gt;
&gt; JohnE
&gt;
&gt;
&gt; -----
&gt; John Eichelsdorfer
&gt;
&gt; http://jobbank.com/ jobbank.com 
&gt;   

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Future development</title>
<author><name>John Eichelsdorfer &lt;jeichels@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200906.mbox/%3c23968977.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c23968977-post@talk-nabble-com%3e</id>
<updated>2009-06-10T19:09:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Is there an active developer still on this project?  Though it would take a
large amount of effort, we are wondering if over time we should move towards
a different bridge technology.  We were not able to get some of the newer
features to work with the 1.0.5 beta mentioned in a former letter and are
not sure if the beta is even coming out still.  Just trying to manage our
risk and planning.

Regards,

JohnE


-----
John Eichelsdorfer

http://jobbank.com/ jobbank.com 
-- 
View this message in context: http://www.nabble.com/Future-development-tp23968977p23968977.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Mandragora 0.3.3 released</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200905.mbox/%3c59f42c000905310730q5a5b406bj3c339e2cf0c927a4@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000905310730q5a5b406bj3c339e2cf0c927a4@mail-gmail-com%3e</id>
<updated>2009-05-31T14:30:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all!
Mandragora 0.3.3 has been released.
The new release has been focused on making easier writing code for
distributed transactions.
http://mandragora.sourceforge.net/referenceguide/ejb.html#Distributed_transactions

It is now very easy using the provided methods to make them work together in
an unique transaction, even on more databases.

Mandragora is a framework that helps building applications providing a
business layer implemented with BD (Business Delegate) , Facade, Application
Service, DAO, Service Locator and Transfer Object patterns; Mandragora
business layer provides 100 of generic methods suitable for the most common
purposes, and helps implementing your core business keeping the j2ee
patterns structure.
The provided DAO has been written with OJB

Everyone that can be interested and have any question, please don't doubt in
writing me.

Best regards

Alessandro Colantoni


</pre>
</div>
</content>
</entry>
<entry>
<title>OJB error, class for key 'ImplementationClass' does not exist</title>
<author><name>Paul Joseph &lt;pjoseph@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200905.mbox/%3c4A0DC7A5.9010005@gmail.com%3e"/>
<id>urn:uuid:%3c4A0DC7A5-9010005@gmail-com%3e</id>
<updated>2009-05-15T19:51:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi There,

My customer wanted me to move a copy of a Cocoon application that's been 
working for four years in production, onto their sales demo Vista laptop.

I did, but get the following problem that prevents any connection being 
made to the database (I don't think it is a password/authentication 
issue, rather it is the first line--that the key 'ImplementationClass' 
does not exist.

Any idea why this is a problem on Vista?

- Scheduler Cocoon_$_Thu_May_14_11:28:36_EDT_2009 started.
[org.apache.ojb.odmg.OJB] ERROR: ConfigurableFactory configuration key 
class for key'ImplementationClass' does not exist.
[org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] ERROR: 
Error getting Connection from DriverManager with url 
(jdbc:postgresql://localhost:5432/WebTask) and driver 
(org.postgresql.Driver)
A connection error has occurred: org.postgresql.util.PSQLException: 
FATAL: password authentication failed for user "WebTask"


Tomcat 5.5.23
Cocoon 2.1.6
Postgresql 8.2.4

I do have a Phoenix server that I was able to move to Vista and which 
connects nicely to the same Postgres database.  Phoenix does not use OJB 
and so I suppose that's where the problem lies.  Any suggestions?

thx
Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Mandragora 0.3.2 Ejb support</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c59f42c000904280305x418c5a31vff44da7924f95223@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000904280305x418c5a31vff44da7924f95223@mail-gmail-com%3e</id>
<updated>2009-04-28T10:05:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,
I would like to notify to all that can be interested that mandragora-0.3.2
has been released.
The ejb implementation has been well tested, so it is now possible to use
all the most common and useful business methods inside an ejb container.


http://mandragora.sourceforge.net/index.html

http://mandragora.sourceforge.net/referenceguide/ejb.html


Regards

Alessandro


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SEVERE: Can't lookup new HighLowSequence for field id using	sequence name SEQ_t_xx_xxx</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c59f42c000904250444u4d6bc61fjef5561ab755a74e2@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000904250444u4d6bc61fjef5561ab755a74e2@mail-gmail-com%3e</id>
<updated>2009-04-25T11:44:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

The first think I'd try, could be to switch to java 1.5 or higher.

Anyway you should say if the error you get is always when executing the same
piece of code or it is "aleatory",

Try to isolate the problem and provide more information.

regards

Alessandro

On Thu, Apr 23, 2009 at 2:43 PM, ChupaMe &lt;chupame@chupame.ch&gt; wrote:

&gt;
&gt; Hello,
&gt;
&gt; does anybody have a clue? Please help.
&gt;
&gt; Thank You!
&gt;
&gt;
&gt;
&gt; ChupaMe wrote:
&gt; &gt;
&gt; &gt; Hi,
&gt; &gt;
&gt; &gt; we have a Problem with Tomcat/MySQL which causes our webapplication to
&gt; &gt; stop working.
&gt; &gt; After a restart of Tomcat and MySQL it works again. But we have to do
&gt; this
&gt; &gt; a few times a day.
&gt; &gt;
&gt; &gt; First some Info about the Server and versions:
&gt; &gt; - SUSE LINUX Enterprise Server 9 (i586) Patchlevel 4
&gt; &gt; - jakarta-tomcat-5.0.19-29.18
&gt; &gt; - mysql-shared-4.0.18-32.37
&gt; &gt; - java2-jre-1.4.2-129.48
&gt; &gt; - java2-1.4.2-129.48
&gt; &gt;
&gt; &gt;
&gt; &gt; Often the follow error occurs the application is blocked:
&gt; &gt;
&gt; &gt; Mar 12, 2009 9:25:19 AM
&gt; &gt; org.apache.ojb.broker.util.logging.CommonsLoggerImpl error
&gt; &gt; SEVERE: Can't lookup new HighLowSequence for field id using sequence name
&gt; &gt; SEQ_t_xx_xxx
&gt; &gt; org.apache.ojb.broker.TransactionInProgressException: Connection is
&gt; &gt; already in transaction
&gt; &gt;         at
&gt; &gt;
&gt; org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown
&gt; &gt; Source)
&gt; &gt;         at
&gt; &gt; org.apache.ojb.broker.core.PersistenceBrokerImpl.beginTransaction(Unknown
&gt; &gt; Source)
&gt; &gt;         …
&gt; &gt;
&gt; &gt; This error is always in relation with the following warnings:
&gt; &gt;
&gt; &gt; 12 Mar 09:20:31  22794068 [http8080-Processor16] WARN
&gt; &gt; ch.XXX.XXX.dh.PersistenceSession  -
&gt; &gt; org.apache.ojb.broker.PersistenceBrokerException:
&gt; &gt; org.apache.ojb.broker.accesslayer.RsIterator$ResourceClosedException:
&gt; &gt; Resources no longer reachable, RsIterator will be automatic cleaned up on
&gt; &gt; PB.close/.commitTransaction/.abortTransaction
&gt; &gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] INFO
&gt; &gt; ch.XXX.XXX.dh.PersistenceSession  - Transaktion abgebrochen
&gt; &gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] WARN
&gt; &gt; ch.XXX.XXX.dh.PersistenceSession  -
&gt; &gt; org.apache.ojb.broker.PersistenceBrokerException: Error while try to
&gt; &gt; assign identity value
&gt; &gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] WARN
&gt; &gt; ch.XXX.XXX.servlets.BestellungSaveServlet  - Error while try to assign
&gt; &gt; identity value
&gt; &gt;
&gt; &gt; Does anybody have a hint?
&gt; &gt;
&gt; &gt; Thank you
&gt; &gt;
&gt;
&gt; --
&gt; View this message in context:
&gt; http://www.nabble.com/SEVERE%3A-Can%27t-lookup-new-HighLowSequence-for-field-id-using-sequence-name-SEQ_t_xx_xxx-tp22558473p23196144.html
&gt; Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive
&gt; at Nabble.com.
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SEVERE: Can't lookup new HighLowSequence for field id using sequence name SEQ_t_xx_xxx</title>
<author><name>ChupaMe &lt;chupame@chupame.ch&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c23196144.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c23196144-post@talk-nabble-com%3e</id>
<updated>2009-04-23T12:43:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hello,

does anybody have a clue? Please help.

Thank You!



ChupaMe wrote:
&gt; 
&gt; Hi,
&gt; 
&gt; we have a Problem with Tomcat/MySQL which causes our webapplication to
&gt; stop working.
&gt; After a restart of Tomcat and MySQL it works again. But we have to do this
&gt; a few times a day.
&gt; 
&gt; First some Info about the Server and versions:
&gt; - SUSE LINUX Enterprise Server 9 (i586) Patchlevel 4
&gt; - jakarta-tomcat-5.0.19-29.18
&gt; - mysql-shared-4.0.18-32.37
&gt; - java2-jre-1.4.2-129.48
&gt; - java2-1.4.2-129.48
&gt; 
&gt; 
&gt; Often the follow error occurs the application is blocked:
&gt; 
&gt; Mar 12, 2009 9:25:19 AM
&gt; org.apache.ojb.broker.util.logging.CommonsLoggerImpl error
&gt; SEVERE: Can't lookup new HighLowSequence for field id using sequence name
&gt; SEQ_t_xx_xxx
&gt; org.apache.ojb.broker.TransactionInProgressException: Connection is
&gt; already in transaction
&gt;         at
&gt; org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown
&gt; Source)
&gt;         at
&gt; org.apache.ojb.broker.core.PersistenceBrokerImpl.beginTransaction(Unknown
&gt; Source)
&gt;         â€¦
&gt; 
&gt; This error is always in relation with the following warnings:
&gt; 
&gt; 12 Mar 09:20:31  22794068 [http8080-Processor16] WARN 
&gt; ch.XXX.XXX.dh.PersistenceSession  -
&gt; org.apache.ojb.broker.PersistenceBrokerException:
&gt; org.apache.ojb.broker.accesslayer.RsIterator$ResourceClosedException:
&gt; Resources no longer reachable, RsIterator will be automatic cleaned up on
&gt; PB.close/.commitTransaction/.abortTransaction
&gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] INFO 
&gt; ch.XXX.XXX.dh.PersistenceSession  - Transaktion abgebrochen
&gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] WARN 
&gt; ch.XXX.XXX.dh.PersistenceSession  -
&gt; org.apache.ojb.broker.PersistenceBrokerException: Error while try to
&gt; assign identity value
&gt; 12 Mar 09:25:19  23081606 [http8080-Processor16] WARN 
&gt; ch.XXX.XXX.servlets.BestellungSaveServlet  - Error while try to assign
&gt; identity value
&gt; 
&gt; Does anybody have a hint?
&gt; 
&gt; Thank you
&gt; 

-- 
View this message in context: http://www.nabble.com/SEVERE%3A-Can%27t-lookup-new-HighLowSequence-for-field-id-using-sequence-name-SEQ_t_xx_xxx-tp22558473p23196144.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: AW: Adding a second data source.</title>
<author><name>=?utf-8?B?QmVybmQgTMOkbmdlcmljaA==?= &lt;b.laengerich@acceptis.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3cD8D5387EF6D20F438FF0F19C6FBDC9768FD746D2@VAVP0E7A.vavp0m.de%3e"/>
<id>urn:uuid:%3cD8D5387EF6D20F438FF0F19C6FBDC9768FD746D2@VAVP0E7A-vavp0m-de%3e</id>
<updated>2009-04-03T08:54:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

in my case, I have two connection descriptors:

	&lt;jdbc-connection-descriptor
      jcd-alias="default"
	default-connection="true"
	...

and 

	&lt;jdbc-connection-descriptor
      jcd-alias="remote"
	default-connection="false"
	...

Using 

      localbroker  = PersistenceBrokerFactory.defaultPersistenceBroker();
      remotebroker = PersistenceBrokerFactory.createPersistenceBroker(new PBKey("remote"));

I can access both data bases.

Best regards
Bernd

-----UrsprÃ¼ngliche Nachricht-----
Von: henrydav [mailto:henrydav@indiana.edu] 
Gesendet: Donnerstag, 2. April 2009 17:33
An: ojb-user@db.apache.org
Betreff: Re: AW: Adding a second data source.


Okay, both responses verify what I thought was true, so thank you for that.
I've tried the approach you mentioned below
(PersistenceBrokerFactory.createPersistenceBroker(new PBKey("myJcdAlias"))),
as well as the Spring approach (since this project also mixes Spring 1.2
in):

setJcdAlias("myJcdAlias");
getPersistenceBrokerTemplate();

In both cases, my dataSource is null, which leads me to believe my jcd-alias
isn't mapped up properly in the jdbc-connection-descriptor. I guess what I
don't understand is how the jcd-alias value is resolved. To what does this
attribute directly refer or map?

Thanks for your help, Bernd and Andrei.


Bernd LÃ¤ngerich wrote:
&gt; 
&gt; Hi,
&gt; 
&gt; You can leave your existing connection as default and add a second (named)
&gt; connection. You have to specify where to use the second connection by
&gt; using an appropriate method (i.e. for the PB-API
&gt; PersistenceBrokerFactory.createPersistenceBroker(new PBKey(jcdalias)) vs.
&gt; PersistenceBrokerFactory.defaultPersistenceBroker()).
&gt; 
&gt; Best regards 
&gt; Bernd
&gt; 
&gt; -----UrsprÃ¼ngliche Nachricht-----
&gt; Von: henrydav [mailto:henrydav@indiana.edu] 
&gt; Gesendet: Donnerstag, 2. April 2009 16:38
&gt; An: ojb-user@db.apache.org
&gt; Betreff: Adding a second data source.
&gt; 
&gt; 
&gt; I'm currently working with a project that uses a single data source, using
&gt; default-connection=true in the jdbc-connection-descriptor. I now need to
&gt; add
&gt; a second data source, but can I leave the first data source as a
&gt; default-connection, or do I need to change it and configure the connection
&gt; programmatically? I'm fairly new to this and I've been reading OJB
&gt; documentation the past couple of days, but I apologize if I'm leaving out
&gt; requisite information.
&gt; -- 
&gt; View this message in context:
&gt; http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html
&gt; Sent from the Apache DB - ObjectRelationalBridge Users mailing list
&gt; archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt; 
&gt; 
&gt; 

-- 
View this message in context: http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22850281.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: AW: Adding a second data source.</title>
<author><name>henrydav &lt;henrydav@indiana.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c22850281.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c22850281-post@talk-nabble-com%3e</id>
<updated>2009-04-02T15:33:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Okay, both responses verify what I thought was true, so thank you for that.
I've tried the approach you mentioned below
(PersistenceBrokerFactory.createPersistenceBroker(new PBKey("myJcdAlias"))),
as well as the Spring approach (since this project also mixes Spring 1.2
in):

setJcdAlias("myJcdAlias");
getPersistenceBrokerTemplate();

In both cases, my dataSource is null, which leads me to believe my jcd-alias
isn't mapped up properly in the jdbc-connection-descriptor. I guess what I
don't understand is how the jcd-alias value is resolved. To what does this
attribute directly refer or map?

Thanks for your help, Bernd and Andrei.


Bernd LÃ¤ngerich wrote:
&gt; 
&gt; Hi,
&gt; 
&gt; You can leave your existing connection as default and add a second (named)
&gt; connection. You have to specify where to use the second connection by
&gt; using an appropriate method (i.e. for the PB-API
&gt; PersistenceBrokerFactory.createPersistenceBroker(new PBKey(jcdalias)) vs.
&gt; PersistenceBrokerFactory.defaultPersistenceBroker()).
&gt; 
&gt; Best regards 
&gt; Bernd
&gt; 
&gt; -----UrsprÃ¼ngliche Nachricht-----
&gt; Von: henrydav [mailto:henrydav@indiana.edu] 
&gt; Gesendet: Donnerstag, 2. April 2009 16:38
&gt; An: ojb-user@db.apache.org
&gt; Betreff: Adding a second data source.
&gt; 
&gt; 
&gt; I'm currently working with a project that uses a single data source, using
&gt; default-connection=true in the jdbc-connection-descriptor. I now need to
&gt; add
&gt; a second data source, but can I leave the first data source as a
&gt; default-connection, or do I need to change it and configure the connection
&gt; programmatically? I'm fairly new to this and I've been reading OJB
&gt; documentation the past couple of days, but I apologize if I'm leaving out
&gt; requisite information.
&gt; -- 
&gt; View this message in context:
&gt; http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html
&gt; Sent from the Apache DB - ObjectRelationalBridge Users mailing list
&gt; archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt; 
&gt; 
&gt; 

-- 
View this message in context: http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22850281.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: Adding a second data source.</title>
<author><name>=?iso-8859-1?Q?Bernd_L=E4ngerich?= &lt;b.laengerich@acceptis.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3cD8D5387EF6D20F438FF0F19C6FBDC9768FC6CF42@VAVP0E7A.vavp0m.de%3e"/>
<id>urn:uuid:%3cD8D5387EF6D20F438FF0F19C6FBDC9768FC6CF42@VAVP0E7A-vavp0m-de%3e</id>
<updated>2009-04-02T15:03:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

You can leave your existing connection as default and add a second (named) connection. You
have to specify where to use the second connection by using an appropriate method (i.e. for
the PB-API PersistenceBrokerFactory.createPersistenceBroker(new PBKey(jcdalias)) vs. PersistenceBrokerFactory.defaultPersistenceBroker()).

Best regards 
Bernd

-----Ursprüngliche Nachricht-----
Von: henrydav [mailto:henrydav@indiana.edu] 
Gesendet: Donnerstag, 2. April 2009 16:38
An: ojb-user@db.apache.org
Betreff: Adding a second data source.


I'm currently working with a project that uses a single data source, using
default-connection=true in the jdbc-connection-descriptor. I now need to add
a second data source, but can I leave the first data source as a
default-connection, or do I need to change it and configure the connection
programmatically? I'm fairly new to this and I've been reading OJB
documentation the past couple of days, but I apologize if I'm leaving out
requisite information.
-- 
View this message in context: http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Adding a second data source.</title>
<author><name>&quot;Andrei Harangus&quot; &lt;andrei.harangus@travelmaster.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c004a01c9b3a2$806d7260$81485720$@harangus@travelmaster.com%3e"/>
<id>urn:uuid:%3c004a01c9b3a2$806d7260$81485720$@harangus@travelmaster-com%3e</id>
<updated>2009-04-02T14:51:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
You can leave the first one default and get the second one programmatically.

-----Original Message-----
From: henrydav [mailto:henrydav@indiana.edu] 
Sent: Thursday, April 02, 2009 5:38 PM
To: ojb-user@db.apache.org
Subject: Adding a second data source.


I'm currently working with a project that uses a single data source, using
default-connection=true in the jdbc-connection-descriptor. I now need to add
a second data source, but can I leave the first data source as a
default-connection, or do I need to change it and configure the connection
programmatically? I'm fairly new to this and I've been reading OJB
documentation the past couple of days, but I apologize if I'm leaving out
requisite information.
-- 
View this message in context:
http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive
at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Adding a second data source.</title>
<author><name>henrydav &lt;henrydav@indiana.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200904.mbox/%3c22849428.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c22849428-post@talk-nabble-com%3e</id>
<updated>2009-04-02T14:37:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I'm currently working with a project that uses a single data source, using
default-connection=true in the jdbc-connection-descriptor. I now need to add
a second data source, but can I leave the first data source as a
default-connection, or do I need to change it and configure the connection
programmatically? I'm fairly new to this and I've been reading OJB
documentation the past couple of days, but I apologize if I'm leaving out
requisite information.
-- 
View this message in context: http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: OJB caching and concurrent access</title>
<author><name>=?iso-8859-1?Q?Bernd_L=E4ngerich?= &lt;b.laengerich@acceptis.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36D43@VAVP0E7A.vavp0m.de%3e"/>
<id>urn:uuid:%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36D43@VAVP0E7A-vavp0m-de%3e</id>
<updated>2009-03-19T08:20:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Ron,

thank you for your helpful hints.

Best regards

Bernd

-----Ursprüngliche Nachricht-----
Von: Ron Bagdanoff [mailto:rbogdanoff@serus.com] 
Gesendet: Mittwoch, 18. März 2009 16:55
An: OJB Users List
Betreff: RE: OJB caching and concurrent access

Don't know if anyone has responded to you on this, but what you need is a distributed cache
implementation.  Unfortunately OJB does not have a distributed cache.  We are using OJB for
our product and we had to build our own distributed cache using JCS and JMS. It is a fair
amount of work to do this plus you will need to maintain that code.

If this is not an existing system and you have not committed to using OJB I would strongly
suggest using Hibernate.  Hibernate has a pluggable cache and a few open source projects have
distributed caches for Hibernate such as EhCache and JBoss cache.  We are starting to use
Hibernate and EhCache on a new project and it is much more robust than OJB.  

If your project uses OJB and you must continue using it, you might what to investigate using
EhCache as a custom level two cache and use it's distributed cache feature, but you will have
to write you own implementation to 'hook it up' to the OJB PB events.

Hope that helps.

Regards
Ron Bogdanoff
Serus Corp

-----Original Message-----
From: Bernd Längerich [mailto:b.laengerich@acceptis.com] 
Sent: Wednesday, March 18, 2009 8:25 AM
To: ojb-user@db.apache.org
Subject: OJB caching and concurrent access

Hello,

I use the PB-API. Is there any support for concurrent access to the same data base entries
from multiple servers/applications in OJB? In order to provide a scalable system and high
availability, I am faced with the demands of load balancing and multiple servers running the
same application and service. At the moment, multiple servers could obtain the same object
instance from the database, caching them, perform changes and possibly updating the data base
without notification of their neighbors. Completely turning off caching is no real option
at the moment.

At the moment, my approach would be to lock the rows in the database during transaction processing,
thus disabling concurrent access to these entries. After transaction is done, the instance
would be held in cache. If subsequent transactions are scheduled to the same server, everything
is fine, but there is a possibility that another server is scheduled one transaction, making
the cached instance obsolete. The best solution would be, that the object instance remains
in cache, but are updated from the database when requested.

Best regards

Bernd


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>AW: OJB caching and concurrent access</title>
<author><name>=?iso-8859-1?Q?Bernd_L=E4ngerich?= &lt;b.laengerich@acceptis.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36D42@VAVP0E7A.vavp0m.de%3e"/>
<id>urn:uuid:%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36D42@VAVP0E7A-vavp0m-de%3e</id>
<updated>2009-03-19T08:20:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Alessandro,

thanks for your response. However, as the long transactions involve external devices and systems
and a strictly sequential order must be assured, I think optimistic locking is not helpful
at all. Besides that, OpenSymphony seems to be interesting anyway.

Best regards

Bernd

-----Ursprüngliche Nachricht-----
Von: Alessandro Colantoni [mailto:alessandro.colantoni@gmail.com] 
Gesendet: Mittwoch, 18. März 2009 16:51
An: OJB Users List
Betreff: Re: OJB caching and concurrent access

Hi Bernd,

did you consider to use the OSCasche implementation with optimistic locking?

http://db.apache.org/ojb/docu/guides/objectcache.html#ObjectCacheOSCacheImpl
http://db.apache.org/ojb/docu/howtos/howto-work-with-clustering.html

I used that sometimes and it is very quick as the entries are not locked,
but you got an exception where you try to store a "dirty read", so catching
it you can decide what to do.

Hope this helps

Alessandro Colantoni




On Wed, Mar 18, 2009 at 4:25 PM, Bernd Längerich
&lt;b.laengerich@acceptis.com&gt;wrote:

&gt; Hello,
&gt;
&gt; I use the PB-API. Is there any support for concurrent access to the same
&gt; data base entries from multiple servers/applications in OJB? In order to
&gt; provide a scalable system and high availability, I am faced with the demands
&gt; of load balancing and multiple servers running the same application and
&gt; service. At the moment, multiple servers could obtain the same object
&gt; instance from the database, caching them, perform changes and possibly
&gt; updating the data base without notification of their neighbors. Completely
&gt; turning off caching is no real option at the moment.
&gt;
&gt; At the moment, my approach would be to lock the rows in the database during
&gt; transaction processing, thus disabling concurrent access to these entries.
&gt; After transaction is done, the instance would be held in cache. If
&gt; subsequent transactions are scheduled to the same server, everything is
&gt; fine, but there is a possibility that another server is scheduled one
&gt; transaction, making the cached instance obsolete. The best solution would
&gt; be, that the object instance remains in cache, but are updated from the
&gt; database when requested.
&gt;
&gt; Best regards
&gt;
&gt; Bernd
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: OJB caching and concurrent access</title>
<author><name>Ron Bagdanoff &lt;rbogdanoff@serus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3c6F12426CCFA9E1478505002C75EF4C0D585A4801CB@svr-mail.seruscorp.local%3e"/>
<id>urn:uuid:%3c6F12426CCFA9E1478505002C75EF4C0D585A4801CB@svr-mail-seruscorp-local%3e</id>
<updated>2009-03-18T15:55:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Don't know if anyone has responded to you on this, but what you need is a distributed cache
implementation.  Unfortunately OJB does not have a distributed cache.  We are using OJB for
our product and we had to build our own distributed cache using JCS and JMS. It is a fair
amount of work to do this plus you will need to maintain that code.

If this is not an existing system and you have not committed to using OJB I would strongly
suggest using Hibernate.  Hibernate has a pluggable cache and a few open source projects have
distributed caches for Hibernate such as EhCache and JBoss cache.  We are starting to use
Hibernate and EhCache on a new project and it is much more robust than OJB.  

If your project uses OJB and you must continue using it, you might what to investigate using
EhCache as a custom level two cache and use it's distributed cache feature, but you will have
to write you own implementation to 'hook it up' to the OJB PB events.

Hope that helps.

Regards
Ron Bogdanoff
Serus Corp

-----Original Message-----
From: Bernd Längerich [mailto:b.laengerich@acceptis.com] 
Sent: Wednesday, March 18, 2009 8:25 AM
To: ojb-user@db.apache.org
Subject: OJB caching and concurrent access

Hello,

I use the PB-API. Is there any support for concurrent access to the same data base entries
from multiple servers/applications in OJB? In order to provide a scalable system and high
availability, I am faced with the demands of load balancing and multiple servers running the
same application and service. At the moment, multiple servers could obtain the same object
instance from the database, caching them, perform changes and possibly updating the data base
without notification of their neighbors. Completely turning off caching is no real option
at the moment.

At the moment, my approach would be to lock the rows in the database during transaction processing,
thus disabling concurrent access to these entries. After transaction is done, the instance
would be held in cache. If subsequent transactions are scheduled to the same server, everything
is fine, but there is a possibility that another server is scheduled one transaction, making
the cached instance obsolete. The best solution would be, that the object instance remains
in cache, but are updated from the database when requested.

Best regards

Bernd


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OJB caching and concurrent access</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3c59f42c000903180851r2596043at433867a5b84fe9e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000903180851r2596043at433867a5b84fe9e@mail-gmail-com%3e</id>
<updated>2009-03-18T15:51:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Bernd,

did you consider to use the OSCasche implementation with optimistic locking?

http://db.apache.org/ojb/docu/guides/objectcache.html#ObjectCacheOSCacheImpl
http://db.apache.org/ojb/docu/howtos/howto-work-with-clustering.html

I used that sometimes and it is very quick as the entries are not locked,
but you got an exception where you try to store a "dirty read", so catching
it you can decide what to do.

Hope this helps

Alessandro Colantoni




On Wed, Mar 18, 2009 at 4:25 PM, Bernd Längerich
&lt;b.laengerich@acceptis.com&gt;wrote:

&gt; Hello,
&gt;
&gt; I use the PB-API. Is there any support for concurrent access to the same
&gt; data base entries from multiple servers/applications in OJB? In order to
&gt; provide a scalable system and high availability, I am faced with the demands
&gt; of load balancing and multiple servers running the same application and
&gt; service. At the moment, multiple servers could obtain the same object
&gt; instance from the database, caching them, perform changes and possibly
&gt; updating the data base without notification of their neighbors. Completely
&gt; turning off caching is no real option at the moment.
&gt;
&gt; At the moment, my approach would be to lock the rows in the database during
&gt; transaction processing, thus disabling concurrent access to these entries.
&gt; After transaction is done, the instance would be held in cache. If
&gt; subsequent transactions are scheduled to the same server, everything is
&gt; fine, but there is a possibility that another server is scheduled one
&gt; transaction, making the cached instance obsolete. The best solution would
&gt; be, that the object instance remains in cache, but are updated from the
&gt; database when requested.
&gt;
&gt; Best regards
&gt;
&gt; Bernd
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>OJB caching and concurrent access</title>
<author><name>=?iso-8859-1?Q?Bernd_L=E4ngerich?= &lt;b.laengerich@acceptis.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36C0D@VAVP0E7A.vavp0m.de%3e"/>
<id>urn:uuid:%3cD8D5387EF6D20F438FF0F19C6FBDC9768FA36C0D@VAVP0E7A-vavp0m-de%3e</id>
<updated>2009-03-18T15:25:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I use the PB-API. Is there any support for concurrent access to the same data base entries
from multiple servers/applications in OJB? In order to provide a scalable system and high
availability, I am faced with the demands of load balancing and multiple servers running the
same application and service. At the moment, multiple servers could obtain the same object
instance from the database, caching them, perform changes and possibly updating the data base
without notification of their neighbors. Completely turning off caching is no real option
at the moment.

At the moment, my approach would be to lock the rows in the database during transaction processing,
thus disabling concurrent access to these entries. After transaction is done, the instance
would be held in cache. If subsequent transactions are scheduled to the same server, everything
is fine, but there is a possibility that another server is scheduled one transaction, making
the cached instance obsolete. The best solution would be, that the object instance remains
in cache, but are updated from the database when requested.

Best regards

Bernd


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>SEVERE: Can't lookup new HighLowSequence for field id using sequence name SEQ_t_xx_xxx</title>
<author><name>ChupaMe &lt;chupame@chupame.ch&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200903.mbox/%3c22558473.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c22558473-post@talk-nabble-com%3e</id>
<updated>2009-03-17T13:13:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,

we have a Problem with Tomcat/MySQL which causes our webapplication to stop
working.
After a restart of Tomcat and MySQL it works again. But we have to do this a
few times a day.

First some Info about the Server and versions:
- SUSE LINUX Enterprise Server 9 (i586) Patchlevel 4
- jakarta-tomcat-5.0.19-29.18
- mysql-shared-4.0.18-32.37
- java2-jre-1.4.2-129.48
- java2-1.4.2-129.48


Often the follow error occurs the application is blocked:

Mar 12, 2009 9:25:19 AM org.apache.ojb.broker.util.logging.CommonsLoggerImpl
error
SEVERE: Can't lookup new HighLowSequence for field id using sequence name
SEQ_t_xx_xxx
org.apache.ojb.broker.TransactionInProgressException: Connection is already
in transaction
        at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.beginTransaction(Unknown
Source)
        â€¦

This error is always in relation with the following warnings:

12 Mar 09:20:31  22794068 [http8080-Processor16] WARN 
ch.XXX.XXX.dh.PersistenceSession  -
org.apache.ojb.broker.PersistenceBrokerException:
org.apache.ojb.broker.accesslayer.RsIterator$ResourceClosedException:
Resources no longer reachable, RsIterator will be automatic cleaned up on
PB.close/.commitTransaction/.abortTransaction
12 Mar 09:25:19  23081606 [http8080-Processor16] INFO 
ch.XXX.XXX.dh.PersistenceSession  - Transaktion abgebrochen
12 Mar 09:25:19  23081606 [http8080-Processor16] WARN 
ch.XXX.XXX.dh.PersistenceSession  -
org.apache.ojb.broker.PersistenceBrokerException: Error while try to assign
identity value
12 Mar 09:25:19  23081606 [http8080-Processor16] WARN 
ch.XXX.XXX.servlets.BestellungSaveServlet  - Error while try to assign
identity value

Does anybody have a hint?

Thank you
-- 
View this message in context: http://www.nabble.com/SEVERE%3A-Can%27t-lookup-new-HighLowSequence-for-field-id-using-sequence-name-SEQ_t_xx_xxx-tp22558473p22558473.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>is OJB a JAR, and other newbie questions</title>
<author><name>Thufir &lt;hawat.thufir@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200902.mbox/%3cgo5d6a$1cp$2@ger.gmane.org%3e"/>
<id>urn:uuid:%3cgo5d6a$1cp$2@ger-gmane-org%3e</id>
<updated>2009-02-26T06:34:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I've just started using the apache packages ECS and DBCP for servlets, 
but would like do more, of course.  Maybe I just can't find the correct 
documentation, but it seems like the fine manual, so to speak, comes in 
two categories.  One glosses over details about where to put files and 
the other assumes knowledge and familiarity which I lack, and all too 
often goes off on tangents into performance tuning instead of how to 
install and use OJB.

I've seen reference to a sample war file which is supposed to be built 
somehow, however I cannot locate it.


question #1:
thufir@arrakis:~/Desktop/db-ojb-1.0.4/lib$ sudo cp db* /usr/share/java -vi
[sudo] password for thufir: 
`db-ojb-1.0.4.jar' -&gt; `/usr/share/java/db-ojb-1.0.4.jar'
`db-ojb-1.0.4-junit.jar' -&gt; `/usr/share/java/db-ojb-1.0.4-junit.jar'
`db-ojb-1.0.4-src.jar' -&gt; `/usr/share/java/db-ojb-1.0.4-src.jar'
`db-ojb-1.0.4-tools.jar' -&gt; `/usr/share/java/db-ojb-1.0.4-tools.jar'


but there are about fifty jars in that lib directory!  I think I have 
most of them, like apache commons, ant, etc.  Surely I don't need to 
manually copy all fifty to /usr/share/java and then manually add all 
fifty or so to the "ojb" library in netbeans?


question #2:

what are the scripts for? how, when and why should you run them?

thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ 
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ 
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ chmod 744 * 
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ ll
total 36
-rwxr--r-- 1 thufir thufir 398 2005-12-31 05:12 build.bat
-rwxr--r-- 1 thufir thufir 609 2005-12-31 05:12 build.sh
-rwxr--r-- 1 thufir thufir  18 2005-12-31 05:12 cp.bat
-rwxr--r-- 1 thufir thufir 398 2005-12-31 05:12 tutorial1.bat
-rwxr--r-- 1 thufir thufir 287 2005-12-31 05:12 tutorial1.sh
-rwxr--r-- 1 thufir thufir 398 2005-12-31 05:12 tutorial2.bat
-rwxr--r-- 1 thufir thufir 261 2005-12-31 05:12 tutorial2.sh
-rwxr--r-- 1 thufir thufir 380 2005-12-31 05:12 tutorial5.bat
-rwxr--r-- 1 thufir thufir 250 2005-12-31 05:12 tutorial5.sh
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ 
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ sudo build.sh 
[sudo] password for thufir: 
sudo: build.sh: command not found
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ ./build.sh
bash: ./build.sh: /bin/sh^M: bad interpreter: No such file or directory
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ 
thufir@arrakis:~/Desktop/db-ojb-1.0.4/bin$ sudo su -
root@arrakis:~# cd /home/thufir/Desktop/db-ojb-1.0.4/bin/
root@arrakis:/home/thufir/Desktop/db-ojb-1.0.4/bin# ./build.sh 
-su: ./build.sh: /bin/sh^M: bad interpreter: No such file or directory
root@arrakis:/home/thufir/Desktop/db-ojb-1.0.4/bin# 
root@arrakis:/home/thufir/Desktop/db-ojb-1.0.4/bin# 

I use bash that frequently, but I think one of those should've worked.


question #3:

The only tutorial I could at least follow was:

http://www.onjava.com/pub/a/onjava/2003/01/08/ojb.html

but it glossed over "installing" ojb.  When doing a web app from Netbeans 
and deploying WAR files to Tomcat, where do all the different 
configuration files go?

When doing a console mockup, where do the files go?

Which sample configuration file would I use for MS SQL server 2005 (not 
my choice)?  I cannot find documentation nor decipher which of the 
following would work best:

thufir@arrakis:~/Desktop/db-ojb-1.0.4/profile$ ll ms*
-rw-r--r-- 1 thufir thufir 5155 2005-12-31 05:12 msaccess.profile
-rw-r--r-- 1 thufir thufir 5294 2005-12-31 05:12 mssqldb-
JSQLConnect.profile
-rw-r--r-- 1 thufir thufir 5392 2005-12-31 05:12 mssqldb-ms.profile
-rw-r--r-- 1 thufir thufir 5345 2005-12-31 05:12 mssqldb-Opta2000.profile
-rw-r--r-- 1 thufir thufir 5290 2005-12-31 05:12 mssqldb.profile
thufir@arrakis:~/Desktop/db-ojb-1.0.4/profile$ 

I think they all say "MS SQL server" for the db type (except the access 
one).



question #4 //see q#1

I've seen reference to "installing" and "testing" OJB.  Is it not just a 
JAR to add to the classpath?

http://ojb.db.terra-intl.com/deployment.html

says that it must be built from source.  Is that out of date?

I'm going through

http://db.apache.org/ojb/docu/guides/deployment.html

but it seems a rather complex way to ship JAR files.  Or, is OJB more 
than just a JAR file?



 

thanks,

Thufir


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: sql statements execution error</title>
<author><name>Prestige Spas &lt;spasprestige@yahoo.com.au&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200902.mbox/%3c95295.17749.qm@web52505.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c95295-17749-qm@web52505-mail-re2-yahoo-com%3e</id>
<updated>2009-02-20T04:17:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Some more info on this issue for anyone that might be able to help:
(Sorry for the size of the post, this gets more interesting around point 6, but i wanted to
be complete)

1. I have started a brand new project from ojb-blank.jar in order to 
diagnose what is going wrong here.

2. Followed the getting-started guide here:
http://db.apache.org/ojb/docu/getting-started.html
as closely as possible to setup for mysql on a remote server
(yes, this server works fine for everything else, same user etc.)

3. Extracted Tutorial 1 jar into the src/java directory

4. Imported project into eclipse

5. Changed build.properties as follows:
USER AND PASSWORD INFO - ALREADY WORKING USER SETUP ON SERVER
jcdAlias=default
databaseName=jerc
databaseUser=jerc
databasePassword=********

MYSQL SETTINGS - ADDED urlMachine for reference in torque.createUrl
dbmsName=MySQL
jdbcLevel=3.0
jdbcRuntimeDriver=com.mysql.jdbc.Driver
urlProtocol=jdbc
urlSubprotocol=mysql
urlMachine=//obelix:3306/
urlDbalias=${urlMachine}${databaseName}

CHANGED CREATEURL - THIS WORKS
torque.database=mysql
torque.database.createUrl=${urlProtocol}:${urlSubprotocol}:${urlMachine}
torque.database.buildUrl=${urlProtocol}:${urlSubprotocol}:${urlDbalias}

jar.name=ojb-blank.jar
ALL OTHER SETTINGS ARE UNCHANGED

6. Setup and Run ant tasks from eclispe
6a. build task output:

Buildfile: /home/brian/Workspace/ojb-blank/build.xml

compile:
       [javac] Compiling 9 source files to /home/brian/Workspace/ojb-blank/build/classes
       [javac] ----------
       [javac] 1. WARNING in /home/brian/Workspace/ojb-blank/src/java/org/apache/ojb/tutorial1/Product.java
(at line 23)
       [javac]     public class Product implements java.io.Serializable
       [javac]                  ^^^^^^^
       [javac] The serializable class Product does not declare a static final serialVersionUID
field of type long
       [javac] ----------
       [javac] 1 problem (1 warning)

xdoclet:
   [ojbdoclet] 2009-02-20 15:01:55,564 [Thread-37] INFO  xdoclet.XDocletMain.start - Running
&lt;ojbrepository/&gt;
   [ojbdoclet] Generating ojb repository descriptor (build/repository_user.xml)
   [ojbdoclet] Type org.apache.ojb.tutorial1.Product
   [ojbdoclet] Processed 1 types
   [ojbdoclet] Processed 1 types
   [ojbdoclet] 2009-02-20 15:01:58,376 [Thread-37] INFO  xdoclet.XDocletMain.start - Running
&lt;torqueschema/&gt;
   [ojbdoclet] Generating torque schema (build/database/project-schema.xml)
   [ojbdoclet] Processed 1 types

build:
        [copy] Copying 7 files to /home/brian/Workspace/ojb-blank/build
       [mkdir] Created dir: /home/brian/Workspace/ojb-blank/build/lib
        [copy] Copying 14 files to /home/brian/Workspace/ojb-blank/build/lib

build_if_with_mainclass:
BUILD SUCCESSFUL
Total time: 7 seconds

6b setup-db task output:

Buildfile: /home/brian/Workspace/ojb-blank/build.xml

compile:

xdoclet:
   [ojbdoclet] 2009-02-20 15:03:01,742 [Thread-38] INFO  xdoclet.XDocletMain.start - Running
&lt;ojbrepository/&gt;
   [ojbdoclet] 2009-02-20 15:03:03,401 [Thread-38] INFO  xdoclet.XDocletMain.start - Running
&lt;torqueschema/&gt;

setup-db:
        [copy] Copying 1 file to /home/brian/Workspace/ojb-blank/build/database

BUILD FAILED
/home/brian/Workspace/ojb-blank/build.xml:185: The following error occurred while executing
this line:
/home/brian/Workspace/ojb-blank/src/schema/build-torque.xml:97: taskdef A class needed by
class org.apache.torque.task.TorqueJDBCTransformTask cannot be found: org.apache.torque.task.TorqueJDBCTransformTask

Total time: 6 seconds

7. Added torque-gen.jar containing TorqueJDBCTransformTask to the eclipse build path, no good.
8. Copied lib dir into src/schema also (eclipse complained about that not existing)
9. Warning for JDBCTransformTask did not go away - all the other warnings did
10. SAME RESULT as 6b
11. Ran "ant setup-db" externally from ~/Workspace/ojb-blank/ in a console:
brian@asterix:~/Workspace/ojb-blank$ ant setup-db
Buildfile: build.xml

compile:

xdoclet:
[ojbdoclet] 2009-02-20 15:06:01,383 [main] INFO  xdoclet.XDocletMain.start - Running &lt;ojbrepository/&gt;
[ojbdoclet] 2009-02-20 15:06:01,626 [main] INFO  xdoclet.XDocletMain.start - Running &lt;torqueschema/&gt;

setup-db:

check-use-classpath:

check-run-only-on-schema-change:

sql-check:

sql:
     [echo] +------------------------------------------+
     [echo] |                                          |
     [echo] | Generating SQL for YOUR Torque project!  |
     [echo] |                                          |
     [echo] +------------------------------------------+

sql-classpath:
     [echo] loading templates from classpath
[torque-sql] Using contextProperties file: /home/brian/Workspace/ojb-blank/build.properties
[torque-sql] Using classpath
[torque-sql] Generating to file /home/brian/Workspace/ojb-blank/build/database/report.jerc.sql.generation
[torque-sql] 2009-02-20 15:06:02,719 [main] INFO  org.apache.torque.engine.database.transform.XmlToAppData
- Parsing file: 'ojbcore-schema.xml'
[torque-sql] 2009-02-20 15:06:02,749 [main] INFO  org.apache.torque.engine.database.transform.DTDResolver
- Resolver: used database.dtd from 'org.apache.torque.engine.database.transform' package
[torque-sql] 2009-02-20 15:06:02,801 [main] INFO  org.apache.torque.engine.database.transform.XmlToAppData
- Parsing file: 'project-schema.xml'
[torque-sql] 2009-02-20 15:06:02,802 [main] INFO  org.apache.torque.engine.database.transform.DTDResolver
- Resolver: used database.dtd from 'org.apache.torque.engine.database.transform' package

sql-template:

create-db-check:

create-db:
[torque-data-model] Using classpath
[torque-data-model] Generating to file /home/brian/Workspace/ojb-blank/build/database/create-db.sql
[torque-data-model] 2009-02-20 15:06:04,049 [main] INFO  org.apache.torque.engine.database.transform.XmlToAppData
- Parsing file: 'ojbcore-schema.xml'
[torque-data-model] 2009-02-20 15:06:04,052 [main] INFO  org.apache.torque.engine.database.transform.DTDResolver
- Resolver: used database.dtd from 'org.apache.torque.engine.database.transform' package
[torque-data-model] 2009-02-20 15:06:04,131 [main] INFO  org.apache.torque.engine.database.transform.XmlToAppData
- Parsing file: 'project-schema.xml'
[torque-data-model] 2009-02-20 15:06:04,132 [main] INFO  org.apache.torque.engine.database.transform.DTDResolver
- Resolver: used database.dtd from 'org.apache.torque.engine.database.transform' package

shutdown-check:

append-shutdown-sql:
     [echo] 
     [echo]       Executing the create-db.sql script ...
     [echo]     
      [sql] Executing resource: /home/brian/Workspace/ojb-blank/build/database/create-db.sql
      [sql] 2 of 2 SQL statements executed successfully

insert-sql:

shutdown-check:

add-shutdown-sql-file:
[torque-sql-exec] Executing file: /home/brian/Workspace/ojb-blank/build/database/project-schema.sql
[torque-sql-exec] Failed to execute: # -----------------------------------------------------------------------
[torque-sql-exec]  # Product # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists Product; CREATE TABLE Product ( id INTEGER NOT NULL,
name VARCHAR (100), price FLOAT, stock INTEGER, PRIMARY KEY(id) );
[torque-sql-exec] com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server version for the right
syntax to use near '; CREATE TABLE Product ( id INTEGER NOT NULL, name VARCHAR (100), price
FLOAT, s' at line 3
[torque-sql-exec] Executing file: /home/brian/Workspace/ojb-blank/build/database/ojbcore-schema.sql
[torque-sql-exec] Failed to execute: # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_HL_SEQ # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_HL_SEQ; CREATE TABLE OJB_HL_SEQ ( TABLENAME VARCHAR
(250) NOT NULL, MAX_KEY BIGINT, GRAB_SIZE INTEGER, VERSION INTEGER, PRIMARY KEY(TABLENAME)
); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_NRM # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_NRM; CREATE TABLE OJB_NRM ( NAME VARCHAR (250)
NOT NULL, OID_ LONGBLOB, PRIMARY KEY(NAME) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DLIST # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DLIST; CREATE TABLE OJB_DLIST ( ID INTEGER NOT
NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DLIST_ENTRIES # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DLIST_ENTRIES; CREATE TABLE OJB_DLIST_ENTRIES
( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, OID_ LONGBLOB, PRIMARY
KEY(ID) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DSET # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DSET; CREATE TABLE OJB_DSET ( ID INTEGER NOT NULL,
SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DSET_ENTRIES # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DSET_ENTRIES; CREATE TABLE OJB_DSET_ENTRIES (
ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, OID_ LONGBLOB, PRIMARY
KEY(ID) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DMAP # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DMAP; CREATE TABLE OJB_DMAP ( ID INTEGER NOT NULL,
SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------------------------------------------------
[torque-sql-exec]  # OJB_DMAP_ENTRIES # -----------------------------------------------------------------------
[torque-sql-exec]  drop table if exists OJB_DMAP_ENTRIES; CREATE TABLE OJB_DMAP_ENTRIES (
ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KEY_OID LONGBLOB, VALUE_OID LONGBLOB, PRIMARY
KEY(ID) );
[torque-sql-exec] com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server version for the right
syntax to use near '; CREATE TABLE OJB_HL_SEQ ( TABLENAME VARCHAR (250) NOT NULL, MAX_KEY
BIGINT, GR' at line 3
[torque-sql-exec] 0 of 2 SQL statements executed successfully

BUILD SUCCESSFUL
Total time: 4 seconds

Still no luck, and now we see the same problem crop up yet again. I tried the following to
debug this:
1. Create an ant task insert-sql in build.xml that directly calls the insert-sql task in build-torque.xml:
    &lt;target name="insert-sql"&gt;
        &lt;property name="torque.buildFile"
                  value="${source.schema.dir}/build-torque.xml"/&gt;
        &lt;property name="torque.project"
                  value="${databaseName}"/&gt;
        &lt;property name="torque.schema.dir"
                  value="${build.dir}/database"/&gt;
        &lt;property name="torque.output.dir"
                  value="${build.dir}/database"/&gt;
        &lt;property name="torque.sql.dir"
                  value="${torque.output.dir}"/&gt;
        &lt;property name="torque.useClasspath"
                  value="true"/&gt;
        &lt;property name="torque.database.driver"
                  value="${jdbcRuntimeDriver}"/&gt;
        &lt;property name="torque.database.user"
                  value="${databaseUser}"/&gt;
        &lt;property name="torque.database.password"
                  value="${databasePassword}"/&gt;
        
        &lt;ant dir="."
             antfile="${torque.buildFile}"
             target="insert-sql"&gt;
        &lt;/ant&gt;
    &lt;/target&gt;

2. Edit the generated project-schema.sql and ojbcore-schema.sql and run "ant insert-sql"
I found that if there is only 1 SQL statement in each .sql file this works! 
For example if project-schema.sql reads:
# -----------------------------------------------------------------------
# Product
# -----------------------------------------------------------------------
drop table if exists Product;

CREATE TABLE Product
(
                    id INTEGER NOT NULL,
                    name VARCHAR (100),
                    price FLOAT,
                    stock INTEGER,
    PRIMARY KEY(id)
);
  
it fails. if i remove everything before CREATE it works, but if I leave the drop table it
fails.
I can leave the comments in and it succeeds.

So my question is - how do I get torque to automatically set up the DB for me? I thought this

would be working out of the box? It is not convinient for me to browse the .sql files
to snip each one out into mysql manually every time i change the schema.

Anyone??? I Really need help on this one.
Thanks,

-- 
Brian




________________________________
From: Prestige Spas &lt;spasprestige@yahoo.com.au&gt;
To: ojb-user@db.apache.org
Sent: Friday, 13 February, 2009 9:54:00 AM
Subject: Re: sql statements execution error

Hello All,

I have searched the archives and not seen an answer to this, but I am having the 
same trouble with the torque "insert-sql" task, as called from the OJB build.xml.
I have attached an old post that shows the exact same problem I am seeing here. 
My project is assembled from ojb-blank.jar and my settings are similar to what is 
reported below, except that I am not running inside of tomcat, simply trying to
develop in eclipse at this stage and run from there. 

"ant setup-db" always returns BUILD SUCESSFUL but the ant task prints all the 
sql statements together and says 0 of 2 statements executed sucessfully, the 
problem being a MySQLSyntaxErrorException thrown when torque is trying to 
create the OJB_HL_SEQ table. I have tried this in ojb-blank.jar also and the
same problem happened from day one. 

I am running OJB 1.0.4 with mysql 5.0.51a and version 5.0.8 of the mysql JDBC
driver. Java version is 1.5.0_16. If anyone out there is able to shed any light on 
this I would appreciate it, as I have been tearing my hair out for days on this now 
and I cannot think what is wrong. Obviously ojb-blank should just work out of the 
box with MySQL, and I think i have set everything up correctly (profile=mysql, 
edit the profile/mysql.profile, torque.database=mysql, dbmsName=MySQL). I have 
tested that the driver works with SQuirreL and mysql-query-browser is able to 
execute the generated SQL statements *individually* from 
build/database/project-schema.sql (but not if i simply paste the whole file).

TIA
-Brian





&gt;Hai,
&gt;
&gt;I have a problem in doing an ant build
&gt;
&gt;The sql statements throw
&gt;
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
an error
&gt;in your SQL syntax; check the manual that corresponds to your MySQL server version for
the
&gt;right syntax to use near 'CREATE TABLE Product ( id INTEGER NOT NULL, name VARCHAR (100),
&gt;price FLOAT, sto' at line 3
&gt;
&gt;I want the ant script to create the database "productmanager" at runtime. I'm using MySQL
&gt;Server version 5.1.6
&gt;
&gt;Below shown is my build.properties file:
&gt;
&gt;jcdAlias=default
&gt;databaseName=productmanager
&gt;databaseUser=root
&gt;databasePassword=root
&gt;
&gt;tomcat.home=${env.CATALINA_HOME}
&gt;tomcat.url=http://localhost:8080
&gt;tomcat.manager.url=${tomcat.url}/manager
&gt;# This user should be present in the $CATALINA_HOME/conf/tomcat-users.xml file with the
role
&gt;'manager':
&gt;tomcat.username=tomcat
&gt;tomcat.password=tomcat
&gt;
&gt;embeddedDatabase=false
&gt;
&gt;dbmsName=MySQL
&gt;jdbcLevel=3.0
&gt;jdbcRuntimeDriver=com.mysql.jdbc.Driver
&gt;urlProtocol=jdbc
&gt;urlSubprotocol=mysql
&gt;urlDbalias=//localhost:3306/${databaseName}
&gt;
&gt;torque.database=mysql
&gt;
&gt;torque.database.createUrl=${urlProtocol}:${urlSubprotocol}://localhost:3306/${databaseName}
&gt;
&gt;torque.database.driver=${jdbcRuntimeDriver}
&gt;
&gt;torque.database.user=${databaseUser}
&gt;
&gt;torque.database.password=${databasePassword}
&gt;
&gt;torque.database.buildUrl=${torque.database.createUrl}
&gt;
&gt;source.dir=src
&gt;source.java.dir=${source.dir}/java
&gt;source.resource.dir=${source.dir}/resources
&gt;source.test.dir=${source.dir}/test
&gt;source.schema.dir=${source.dir}/schema
&gt;source.webapp.dir=${source.dir}/webapp
&gt;
&gt;build.dir=build
&gt;lib.dir=lib
&gt;lib.webapp.excludes=xdoclet*.jar,xjavadoc*.jar,torque*.jar,velocity*.jar
&gt;
&gt;target.dir=target
&gt;
&gt;servlet.lib=${tomcat.home}/common/lib/servlet-api.jar
&gt;jsp.lib=${tomcat.home}/common/lib/jsp-api.jar
&gt;deploy.dir=${tomcat.home}/webapps
&gt;
&gt;embedded.database.excludes=*schema.xml,*.sql,*.sql.generation,sqldb.map
&gt;
&gt;
&gt;
&gt;Below shown is the log details: (see the highlighted text in red color)
&gt;
&gt;C:\Users\karthiksg\Desktop\webapp-sample\webapp-sample&gt;ant
&gt;Buildfile: build.xml
&gt;
&gt;compile:
&gt;
&gt;xdoclet:
&gt;[ojbdoclet] 2008-11-09 17:51:00,188 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;ojbrepository/&gt;
&gt;[ojbdoclet] 2008-11-09 17:51:00,783 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;torqueschema/&gt;
&gt;
&gt;war:
&gt;
&gt;compile:
&gt;
&gt;xdoclet:
&gt;[ojbdoclet] 2008-11-09 17:51:02,105 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;ojbrepository/&gt;
&gt;[ojbdoclet] 2008-11-09 17:51:02,604 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;torqueschema/&gt;
&gt;
&gt;setup-db:
&gt;
&gt;check-use-classpath:
&gt;
&gt;check-run-only-on-schema-change:
&gt;
&gt;sql-check:
&gt;
&gt;sql:
&gt;[echo] +------------------------------------------+
&gt;[echo] |                                          |
&gt;[echo] | Generating SQL for YOUR Torque project!  |
&gt;[echo] |                                          |
&gt;[echo] +------------------------------------------+
&gt;
&gt;sql-classpath:
&gt;[echo] loading templates from classpath
&gt;[torque-sql] Using contextProperties file: C:\Users\karthiksg\Desktop\webapp-sam
&gt;ple\webapp-sample\build.properties
&gt;[torque-sql] Using classpath
&gt;[torque-sql] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\webapp-
&gt;sample\build\database\report.productmanager.sql.generation
&gt;[torque-sql] 2008-11-09 17:51:04,499 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
&gt;[torque-sql] 2008-11-09 17:51:04,522 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.torque.
&gt;engine.database.transform' package
&gt;[torque-sql] 2008-11-09 17:51:04,595 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.XmlToAppData - Parsing file: 'project-schema.xml'
&gt;[torque-sql] 2008-11-09 17:51:04,600 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/dtd/data
&gt;base_3_0_1.dtd'
&gt;
&gt;sql-template:
&gt;
&gt;create-db-check:
&gt;
&gt;create-db:
&gt;[torque-data-model] Using classpath
&gt;[torque-data-model] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\
&gt;webapp-sample\build\database\create-db.sql
&gt;[torque-data-model] 2008-11-09 17:51:25,378 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
&gt;[torque-data-model] 2008-11-09 17:51:25,392 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.
&gt;torque.engine.database.transform' package
&gt;[torque-data-model] 2008-11-09 17:51:25,457 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.XmlToAppData - Parsing file: 'project-schema.xml'
&gt;[torque-data-model] 2008-11-09 17:51:25,463 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/d
&gt;td/database_3_0_1.dtd'
&gt;
&gt;shutdown-check:
&gt;
&gt;append-shutdown-sql:
&gt;[echo]
&gt;[echo]       Executing the create-db.sql script ...
&gt;[echo]
&gt;[sql] Executing resource: C:\Users\karthiksg\Desktop\webapp-sample\webapp-
&gt;sample\build\database\create-db.sql
&gt;[sql] 2 of 2 SQL statements executed successfully
&gt;
&gt;insert-sql:
&gt;
&gt;shutdown-check:
&gt;
&gt;add-shutdown-sql-file:
&gt;[torque-sql-exec] Our new url -&gt; jdbc:mysql://localhost:3306/productmanager
&gt;[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
&gt;p-sample\build\database\project-schema.sql
&gt;[torque-sql-exec] Failed to execute: # -----------------------------------------
&gt;------------------------------
&gt;[torque-sql-exec]  # Product # -------------------------------------------------
&gt;----------------------
&gt;[torque-sql-exec]  drop table if exists Product; CREATE TABLE Product ( id INTEG
&gt;ER NOT NULL, name VARCHAR (100), price FLOAT, stock INTEGER, PRIMARY KEY(id) );
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
&gt;have an error in your SQL syntax; check the manual that corresponds to your MyS
&gt;QL server version for the right syntax to use near 'CREATE TABLE Product ( id IN
&gt;TEGER NOT NULL, name VARCHAR (100), price FLOAT, sto' at line 3
&gt;[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
&gt;p-sample\build\database\ojbcore-schema.sql
&gt;[torque-sql-exec] Failed to execute: # -----------------------------------------
&gt;------------------------------
&gt;[torque-sql-exec]  # OJB_HL_SEQ # ----------------------------------------------
&gt;-------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_HL_SEQ; CREATE TABLE OJB_HL_SEQ ( TA
&gt;BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB_SIZE INTEGER, VERSION INTEG
&gt;ER, PRIMARY KEY(TABLENAME) ); # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  # OJB_NRM # -------------------------------------------------
&gt;----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_NRM; CREATE TABLE OJB_NRM ( NAME VAR
&gt;CHAR (250) NOT NULL, OID_ LONGBLOB, PRIMARY KEY(NAME) ); # ---------------------
&gt;--------------------------------------------------
&gt;[torque-sql-exec]  # OJB_DLIST # -----------------------------------------------
&gt;------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DLIST; CREATE TABLE OJB_DLIST ( ID I
&gt;NTEGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # ---------------------------
&gt;--------------------------------------------
&gt;[torque-sql-exec]  # OJB_DLIST_ENTRIES # ---------------------------------------
&gt;--------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DLIST_ENTRIES; CREATE TABLE OJB_DLIS
&gt;T_ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, O
&gt;ID_ LONGBLOB, PRIMARY KEY(ID) ); # ---------------------------------------------
&gt;--------------------------
&gt;[torque-sql-exec]  # OJB_DSET # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DSET; CREATE TABLE OJB_DSET ( ID INT
&gt;EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
&gt;------------------------------------------
&gt;[torque-sql-exec]  # OJB_DSET_ENTRIES # ----------------------------------------
&gt;-------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DSET_ENTRIES; CREATE TABLE OJB_DSET_
&gt;ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, OID
&gt;_ LONGBLOB, PRIMARY KEY(ID) ); # -----------------------------------------------
&gt;------------------------
&gt;[torque-sql-exec]  # OJB_DMAP # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DMAP; CREATE TABLE OJB_DMAP ( ID INT
&gt;EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
&gt;------------------------------------------
&gt;[torque-sql-exec]  # OJB_DMAP_ENTRIES # ----------------------------------------
&gt;-------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DMAP_ENTRIES; CREATE TABLE OJB_DMAP_
&gt;ENTRIES ( ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KEY_OID LONGBLOB, VALUE
&gt;_OID LONGBLOB, PRIMARY KEY(ID) );
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
&gt;have an error in your SQL syntax; check the manual that corresponds to your MyS
&gt;QL server version for the right syntax to use near 'CREATE TABLE OJB_HL_SEQ ( TA
&gt;BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB' at line 3
&gt;[torque-sql-exec] 0 of 2 SQL statements executed successfully
&gt;
&gt;copy-database-files:
&gt;
&gt;BUILD SUCCESSFUL
&gt;Total time: 46 seconds
&gt;
&gt;I can see the files build\database\createdb.sql ,
&gt;build\database\ojbcore-schema.sql ,
&gt;build\database\project-schema.sql 
&gt;
&gt;I can copy the statements from the .sql listed above and execute successfully in mysql
command
&gt;window.
&gt;
&gt;kindly do the needfull.


      Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Mnadragora 0.3.1, new powerful methods</title>
<author><name>Alessandro Colantoni &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200902.mbox/%3c59f42c000902170633y2ada2c0j3b4d80ba662f16f7@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000902170633y2ada2c0j3b4d80ba662f16f7@mail-gmail-com%3e</id>
<updated>2009-02-17T14:33:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

to everybody who is interested in Mandragora, just notify that the new
version 0.3.1 has been released.(
http://mandragora.sourceforge.net/index.html)

There are new methods available, as

storePathsCascade(Object storeVO,Collection paths, Boolean
pathsHasToBeSorted, Boolean storeVOHasToBeStored)

that store trees of value obejcts.

The tree is represented by *storeVO*, that is the value object root, and *
paths*, that is a collection of strings that are the paths of the tree from
the root Each element of *paths* is a dot separated list of attributes; for
example it could be:

*attribute_1.attribute_2.attribute_3.attribute_4*

The store cascade is applied even if not specified in the repository.xml.

This method can be considered a way to specify the autoupdate at runtime.

Analogously an other method is


deletePathsCascade(Object parentVO, Collection paths,Boolean
ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne),


but there are many other ones.


Hoping this can help ojb - users


Best regards


Alessandro Colantoni

http://mandragora.sourceforge.net/index.html


*
*


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: sql statements execution error</title>
<author><name>Prestige Spas &lt;spasprestige@yahoo.com.au&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200902.mbox/%3c47072.52225.qm@web52505.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c47072-52225-qm@web52505-mail-re2-yahoo-com%3e</id>
<updated>2009-02-12T22:54:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello All,

I have searched the archives and not seen an answer to this, but I am having the 
same trouble with the torque "insert-sql" task, as called from the OJB build.xml.
I have attached an old post that shows the exact same problem I am seeing here. 
My project is assembled from ojb-blank.jar and my settings are similar to what is 
reported below, except that I am not running inside of tomcat, simply trying to
develop in eclipse at this stage and run from there. 

"ant setup-db" always returns BUILD SUCESSFUL but the ant task prints all the 
sql statements together and says 0 of 2 statements executed sucessfully, the 
problem being a MySQLSyntaxErrorException thrown when torque is trying to 
create the OJB_HL_SEQ table. I have tried this in ojb-blank.jar also and the
same problem happened from day one. 

I am running OJB 1.0.4 with mysql 5.0.51a and version 5.0.8 of the mysql JDBC
driver. Java version is 1.5.0_16. If anyone out there is able to shed any light on 
this I would appreciate it, as I have been tearing my hair out for days on this now 
and I cannot think what is wrong. Obviously ojb-blank should just work out of the 
box with MySQL, and I think i have set everything up correctly (profile=mysql, 
edit the profile/mysql.profile, torque.database=mysql, dbmsName=MySQL). I have 
tested that the driver works with SQuirreL and mysql-query-browser is able to 
execute the generated SQL statements *individually* from 
build/database/project-schema.sql (but not if i simply paste the whole file).

TIA
-Brian





&gt;Hai,
&gt;
&gt;I have a problem in doing an ant build
&gt;
&gt;The sql statements throw
&gt;
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
an error
&gt;in your SQL syntax; check the manual that corresponds to your MySQL server version for
the
&gt;right syntax to use near 'CREATE TABLE Product ( id INTEGER NOT NULL, name VARCHAR (100),
&gt;price FLOAT, sto' at line 3
&gt;
&gt;I want the ant script to create the database "productmanager" at runtime. I'm using MySQL
&gt;Server version 5.1.6
&gt;
&gt;Below shown is my build.properties file:
&gt;
&gt;jcdAlias=default
&gt;databaseName=productmanager
&gt;databaseUser=root
&gt;databasePassword=root
&gt;
&gt;tomcat.home=${env.CATALINA_HOME}
&gt;tomcat.url=http://localhost:8080
&gt;tomcat.manager.url=${tomcat.url}/manager
&gt;# This user should be present in the $CATALINA_HOME/conf/tomcat-users.xml file with the
role
&gt;'manager':
&gt;tomcat.username=tomcat
&gt;tomcat.password=tomcat
&gt;
&gt;embeddedDatabase=false
&gt;
&gt;dbmsName=MySQL
&gt;jdbcLevel=3.0
&gt;jdbcRuntimeDriver=com.mysql.jdbc.Driver
&gt;urlProtocol=jdbc
&gt;urlSubprotocol=mysql
&gt;urlDbalias=//localhost:3306/${databaseName}
&gt;
&gt;torque.database=mysql
&gt;
&gt;torque.database.createUrl=${urlProtocol}:${urlSubprotocol}://localhost:3306/${databaseName}
&gt;
&gt;torque.database.driver=${jdbcRuntimeDriver}
&gt;
&gt;torque.database.user=${databaseUser}
&gt;
&gt;torque.database.password=${databasePassword}
&gt;
&gt;torque.database.buildUrl=${torque.database.createUrl}
&gt;
&gt;source.dir=src
&gt;source.java.dir=${source.dir}/java
&gt;source.resource.dir=${source.dir}/resources
&gt;source.test.dir=${source.dir}/test
&gt;source.schema.dir=${source.dir}/schema
&gt;source.webapp.dir=${source.dir}/webapp
&gt;
&gt;build.dir=build
&gt;lib.dir=lib
&gt;lib.webapp.excludes=xdoclet*.jar,xjavadoc*.jar,torque*.jar,velocity*.jar
&gt;
&gt;target.dir=target
&gt;
&gt;servlet.lib=${tomcat.home}/common/lib/servlet-api.jar
&gt;jsp.lib=${tomcat.home}/common/lib/jsp-api.jar
&gt;deploy.dir=${tomcat.home}/webapps
&gt;
&gt;embedded.database.excludes=*schema.xml,*.sql,*.sql.generation,sqldb.map
&gt;
&gt;
&gt;
&gt;Below shown is the log details: (see the highlighted text in red color)
&gt;
&gt;C:\Users\karthiksg\Desktop\webapp-sample\webapp-sample&gt;ant
&gt;Buildfile: build.xml
&gt;
&gt;compile:
&gt;
&gt;xdoclet:
&gt;[ojbdoclet] 2008-11-09 17:51:00,188 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;ojbrepository/&gt;
&gt;[ojbdoclet] 2008-11-09 17:51:00,783 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;torqueschema/&gt;
&gt;
&gt;war:
&gt;
&gt;compile:
&gt;
&gt;xdoclet:
&gt;[ojbdoclet] 2008-11-09 17:51:02,105 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;ojbrepository/&gt;
&gt;[ojbdoclet] 2008-11-09 17:51:02,604 [main] INFO  xdoclet.XDocletMain.start - Run
&gt;ning &lt;torqueschema/&gt;
&gt;
&gt;setup-db:
&gt;
&gt;check-use-classpath:
&gt;
&gt;check-run-only-on-schema-change:
&gt;
&gt;sql-check:
&gt;
&gt;sql:
&gt;[echo] +------------------------------------------+
&gt;[echo] |                                          |
&gt;[echo] | Generating SQL for YOUR Torque project!  |
&gt;[echo] |                                          |
&gt;[echo] +------------------------------------------+
&gt;
&gt;sql-classpath:
&gt;[echo] loading templates from classpath
&gt;[torque-sql] Using contextProperties file: C:\Users\karthiksg\Desktop\webapp-sam
&gt;ple\webapp-sample\build.properties
&gt;[torque-sql] Using classpath
&gt;[torque-sql] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\webapp-
&gt;sample\build\database\report.productmanager.sql.generation
&gt;[torque-sql] 2008-11-09 17:51:04,499 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
&gt;[torque-sql] 2008-11-09 17:51:04,522 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.torque.
&gt;engine.database.transform' package
&gt;[torque-sql] 2008-11-09 17:51:04,595 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.XmlToAppData - Parsing file: 'project-schema.xml'
&gt;[torque-sql] 2008-11-09 17:51:04,600 [main] INFO  org.apache.torque.engine.datab
&gt;ase.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/dtd/data
&gt;base_3_0_1.dtd'
&gt;
&gt;sql-template:
&gt;
&gt;create-db-check:
&gt;
&gt;create-db:
&gt;[torque-data-model] Using classpath
&gt;[torque-data-model] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\
&gt;webapp-sample\build\database\create-db.sql
&gt;[torque-data-model] 2008-11-09 17:51:25,378 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
&gt;[torque-data-model] 2008-11-09 17:51:25,392 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.
&gt;torque.engine.database.transform' package
&gt;[torque-data-model] 2008-11-09 17:51:25,457 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.XmlToAppData - Parsing file: 'project-schema.xml'
&gt;[torque-data-model] 2008-11-09 17:51:25,463 [main] INFO  org.apache.torque.engin
&gt;e.database.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/d
&gt;td/database_3_0_1.dtd'
&gt;
&gt;shutdown-check:
&gt;
&gt;append-shutdown-sql:
&gt;[echo]
&gt;[echo]       Executing the create-db.sql script ...
&gt;[echo]
&gt;[sql] Executing resource: C:\Users\karthiksg\Desktop\webapp-sample\webapp-
&gt;sample\build\database\create-db.sql
&gt;[sql] 2 of 2 SQL statements executed successfully
&gt;
&gt;insert-sql:
&gt;
&gt;shutdown-check:
&gt;
&gt;add-shutdown-sql-file:
&gt;[torque-sql-exec] Our new url -&gt; jdbc:mysql://localhost:3306/productmanager
&gt;[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
&gt;p-sample\build\database\project-schema.sql
&gt;[torque-sql-exec] Failed to execute: # -----------------------------------------
&gt;------------------------------
&gt;[torque-sql-exec]  # Product # -------------------------------------------------
&gt;----------------------
&gt;[torque-sql-exec]  drop table if exists Product; CREATE TABLE Product ( id INTEG
&gt;ER NOT NULL, name VARCHAR (100), price FLOAT, stock INTEGER, PRIMARY KEY(id) );
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
&gt;have an error in your SQL syntax; check the manual that corresponds to your MyS
&gt;QL server version for the right syntax to use near 'CREATE TABLE Product ( id IN
&gt;TEGER NOT NULL, name VARCHAR (100), price FLOAT, sto' at line 3
&gt;[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
&gt;p-sample\build\database\ojbcore-schema.sql
&gt;[torque-sql-exec] Failed to execute: # -----------------------------------------
&gt;------------------------------
&gt;[torque-sql-exec]  # OJB_HL_SEQ # ----------------------------------------------
&gt;-------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_HL_SEQ; CREATE TABLE OJB_HL_SEQ ( TA
&gt;BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB_SIZE INTEGER, VERSION INTEG
&gt;ER, PRIMARY KEY(TABLENAME) ); # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  # OJB_NRM # -------------------------------------------------
&gt;----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_NRM; CREATE TABLE OJB_NRM ( NAME VAR
&gt;CHAR (250) NOT NULL, OID_ LONGBLOB, PRIMARY KEY(NAME) ); # ---------------------
&gt;--------------------------------------------------
&gt;[torque-sql-exec]  # OJB_DLIST # -----------------------------------------------
&gt;------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DLIST; CREATE TABLE OJB_DLIST ( ID I
&gt;NTEGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # ---------------------------
&gt;--------------------------------------------
&gt;[torque-sql-exec]  # OJB_DLIST_ENTRIES # ---------------------------------------
&gt;--------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DLIST_ENTRIES; CREATE TABLE OJB_DLIS
&gt;T_ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, O
&gt;ID_ LONGBLOB, PRIMARY KEY(ID) ); # ---------------------------------------------
&gt;--------------------------
&gt;[torque-sql-exec]  # OJB_DSET # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DSET; CREATE TABLE OJB_DSET ( ID INT
&gt;EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
&gt;------------------------------------------
&gt;[torque-sql-exec]  # OJB_DSET_ENTRIES # ----------------------------------------
&gt;-------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DSET_ENTRIES; CREATE TABLE OJB_DSET_
&gt;ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, OID
&gt;_ LONGBLOB, PRIMARY KEY(ID) ); # -----------------------------------------------
&gt;------------------------
&gt;[torque-sql-exec]  # OJB_DMAP # ------------------------------------------------
&gt;-----------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DMAP; CREATE TABLE OJB_DMAP ( ID INT
&gt;EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
&gt;------------------------------------------
&gt;[torque-sql-exec]  # OJB_DMAP_ENTRIES # ----------------------------------------
&gt;-------------------------------
&gt;[torque-sql-exec]  drop table if exists OJB_DMAP_ENTRIES; CREATE TABLE OJB_DMAP_
&gt;ENTRIES ( ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KEY_OID LONGBLOB, VALUE
&gt;_OID LONGBLOB, PRIMARY KEY(ID) );
&gt;[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
&gt;have an error in your SQL syntax; check the manual that corresponds to your MyS
&gt;QL server version for the right syntax to use near 'CREATE TABLE OJB_HL_SEQ ( TA
&gt;BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB' at line 3
&gt;[torque-sql-exec] 0 of 2 SQL statements executed successfully
&gt;
&gt;copy-database-files:
&gt;
&gt;BUILD SUCCESSFUL
&gt;Total time: 46 seconds
&gt;
&gt;I can see the files build\database\createdb.sql ,
&gt;build\database\ojbcore-schema.sql ,
&gt;build\database\project-schema.sql 
&gt;
&gt;I can copy the statements from the .sql listed above and execute successfully in mysql
command
&gt;window.
&gt;
&gt;kindly do the needfull.


      Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: extents, mapping classes to joined tables and collection-type field</title>
<author><name>Maxim Kuleshov &lt;kuleshov@org.vrn.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200901.mbox/%3c20090130095304.634ad21c@kme.ic.vrn.ru%3e"/>
<id>urn:uuid:%3c20090130095304-634ad21c@kme-ic-vrn-ru%3e</id>
<updated>2009-01-30T06:53:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Thu, 29 Jan 2009 15:18:14 +0300
Maxim Kuleshov &lt;kuleshov@org.vrn.ru&gt; wrote:

&gt; That's scheme gives me error during XDoclet stage:
&gt; 
&gt; "The collection entries in class ojbs.ObjsList specifies a foreignkey
&gt; listId that is not a persistent field in the element class (or its
&gt; subclass) objs.B"

Well, this problem has been solved. The answer is I mixed up extents and
multiple-joined tables concepts.

But another problem still persists. Then storing instance of classB
its foreign key to classA (prentId), declared as anonymous is not
set automatically, so reference between table_a and table_b is lost and
when loading classB all fields declared in classA are nulls.

The only way to preserve references is to use primary key of classB
(id) as a foreign key to classA. But how to force sequence-manager
generate its value only once (if every class has its own instance of
id).

I use XDoclet, and it doesn't allow to inherit particullar field.
Moreover, it doesn't allow to ignore duplicate fields, as listId among
then and class ObjsList has collection back-referencing via that field.

If I put obj.field declaration with name attribute it always become
anonymous (which is not true).



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>extents, mapping classes to joined tables and collection-type field</title>
<author><name>Maxim Kuleshov &lt;kuleshov@org.vrn.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200901.mbox/%3c20090129151814.7c5e6cb1@kme.ic.vrn.ru%3e"/>
<id>urn:uuid:%3c20090129151814-7c5e6cb1@kme-ic-vrn-ru%3e</id>
<updated>2009-01-29T12:18:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi!

How could I configure OJB to process such scheme:

I have base class A and at least one its subclass B. Each class uses
different DB tables, joined to each other. In following examples I have
TABLE_B references to TABLE_A by foreign key PARENT_ID.

There is also third class, lets say 'ObjList' having 1:n relation to
base class A.

Java code looks like this:

package objs;

/* @ojb.class table="TABLE_A"
 * @ojb.extent class-ref="objs.B"
 * @ojb.field name="listId"
 *            column="list_id"
 *            jdbc-type="INTEGER"
 */
class A {
  /* @ojb.field column="id"
   *            jdbc-type="INTEGER"
   *            primarykey="true"
   */
  int id;

  /* @ojb.field column="field1"
   *            jdbc-type="INTEGER" 
   */
  int field1;

  /* @ojb.field column="field2"
   *            jdbc-type="INTEGER"
   */
  int field2;

  /* @ojb.reference foreignkey="listId"
   *                auto-retrieve="true"
   *                auto-update="link"
   *                auto-delete="link"
   */
  ObjsList list;
  
}

/* @ojb.class table="TABLE_B"
 *            include-inherited="false"
 * @ojb.field name="id"
 *            jdbc-type="INTEGER"
 *            column="id"
 *            primarykey="true"
 * @ojb.field name="parentId"
 *            column="parent_id"
 *            jdbc-type="INTEGER"
 *            access="anonymous"
 * @ojb.reference class-ref="objs.A"
 *                auto-retrieve="true"
 *                auto-update="object"
 *                auto-delete="object"
 *                foreignkey="parentId"
 */
class B extends A {
  /* @ojb.field column="field3"
   *            jdbc-type="INTEGER" */
  int field3;
}

class ObjsList {
  ... various fields ...

/* @ojb.collection
  * element-class-ref="objs.A"
  * foreignkey="listId"
  * auto-retreive="true"
  * auto-update="link"
  * audo-delete="none"
  * proxy="true"
  */
  List&lt;A&gt; objs;
}

That's scheme gives me error during XDoclet stage:

"The collection entries in class ojbs.ObjsList specifies a foreignkey
listId that is not a persistent field in the element class (or its
subclass) objs.B"

If I include declaration of listId field to class "B" (via
include-inherited="true" or place separate ojb.field to class B, then
OJB suppose TABLE_B have LIST_ID column, though it doesn't.

The following SQL generated when method getObjs() invoked on ObjsList
instance.

SELECT count(*) FROM TABLE_B A0 INNER JOIN
TABLE_A A1 ON A0.parent_id=A1.id WHERE A0.list_id = ?

Why OJB forces class B have listId?

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Mandragora 0.3 released</title>
<author><name>&quot;Alessandro Colantoni&quot; &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200901.mbox/%3c59f42c000901061159g17d1a3d2u6e2a187d4e95a52c@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000901061159g17d1a3d2u6e2a187d4e95a52c@mail-gmail-com%3e</id>
<updated>2009-01-06T19:59:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Just to notify, to everyone that could be interested that a new version of
Mandragora (http://mandragora.sourceforge.net/) has been released.

New methods have been added, and some limitation of the existing ones have
been removed.
The architecture provided by Mandragora is now more complex, not just
providing the simple chain BD--&gt;DAO, but providing a structure implementing
the pattern BD, Service FAcade, Application Service and DAO, providing
components collaborating together to provide a suitable j2ee architecture,
very easy to extend and customize to the specifications of the application
you have to realize.
Just put mandagora.jar in your library, configure Mandragora.properties in
your classpath, and you will have available a lot of DAO methods implemented
with Ojb persistence broker, that can be used directly, or are used to
implements business methods, in turns yet ready to use.
Using Mandragora you don't have to build the architecture of your
application. That's already done, and having almost 100  business methods,
your are going to save lots of time.
If you are enough skilled with Ojb Persistence broker, there is almost
nothing to learn, and you can be ready to use it  20 minutes reading the
documentation.

http://mandragora.sourceforge.net/


Any comment, help or other would be appreciated a lot.

Thanks in advance, sorry for the annoyance, and have a happy new year


</pre>
</div>
</content>
</entry>
<entry>
<title>AS400 Column Mapping Resultset DATE TIME</title>
<author><name>Tokajac &lt;imre_tokai@hotmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200811.mbox/%3c20758759.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c20758759-post@talk-nabble-com%3e</id>
<updated>2008-11-30T15:39:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hello,


I'm mapping columns of types DATE(10), TIME(8):

&lt;parameter property="ORGDEPDT" jdbcType="DATE" javaType="java.lang.String"
mode="OUT"/&gt;
&lt;parameter property="ORGDEPTM" jdbcType="TIME" javaType="java.lang.String"
mode="OUT"/&gt;
&lt;parameter property="DSTDEPDT" jdbcType="DATE" javaType="java.lang.String"
mode="OUT"/&gt;
&lt;parameter property="DSTDEPTM" jdbcType="TIME" javaType="java.lang.String"
mode="OUT"/&gt;


and i get Exception:

javax.servlet.ServletException:
--- The error occurred in
com/linehaul/persistence/sql/LineHaulManifests.xml.
--- The error occurred while applying a parameter map.
--- Check the ApplicationSP.Params.
--- Check the statement (update procedure failed).
--- Cause: java.sql.SQLException: [SQL0180] Syntax of date, time, or
timestamp value not valid. Cause . . . . . : The string representation of a
date, time, or timestamp value does not conform to the syntax for the
specified or implied data type and format. *N is either the character string
constant that is not valid or the column or host variable that contained the
string. If the name is *N, then the value is an expression specified in the
statement. If the string was found in a host variable, the host variable
number is 9. Recovery . . . : Ensure that the date, time, or timestamp value
conforms to the syntax for the data type it represents. Try the request
again.
org.apache.struts.action.RequestProcessor.processE
xception(RequestProcessor.java:535)


Any useful hint for solving this?


Regards
-- 
View this message in context: http://www.nabble.com/AS400-Column-Mapping-Resultset-DATE-TIME-tp20758759p20758759.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>How can I make OJB to create a &quot;select&quot; on a select statement, not on a table?</title>
<author><name>&quot;Hiller, Frank RD-PT31&quot; &lt;Frank.Hiller@heidelberg.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200811.mbox/%3cBA096D1AF8AE9F408CA552890F7C14010537900EB2@wiems02002.ceu.corp.heidelberg.com%3e"/>
<id>urn:uuid:%3cBA096D1AF8AE9F408CA552890F7C14010537900EB2@wiems02002-ceu-corp-heidelberg-com%3e</id>
<updated>2008-11-25T18:42:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I'm using "ReportQueryByCriteria" of the PB API in OJB 1.0.3.

What I'm trying to do is to create a statement like this:
SELECT columnA, columnB, columnC FROM ( select ... from tableName where ...)

OJB always creates a statement like this:
SELECT A0.columnA, A0.columnB, A0.columnC FROM tableName A0 WHERE ...

How can I make OJB to create a "select" on a select statement, not on a table?

Thanks
Frank



  ________________________________
Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary
information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged
or otherwise protected from disclosure. If you are not the intended recipient, you are hereby
notified that any review, reliance or distribution by others or forwarding without express
permission is strictly prohibited and may cause liability. In case you have received this
message due to an error in transmission, we kindly ask you to notify the sender immediately
and to delete this email and any attachment from your system.


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Query against an interface</title>
<author><name>&quot;Janssen, Roger&quot; &lt;roger.janssen@ibanx.nl&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200811.mbox/%3c2D4F9F8D30B7A847BEF849316269A3A5F10EC7@VERONA.kantoor.ibanx.nl%3e"/>
<id>urn:uuid:%3c2D4F9F8D30B7A847BEF849316269A3A5F10EC7@VERONA-kantoor-ibanx-nl%3e</id>
<updated>2008-11-20T09:23:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I am not sure but I don't think so. OJB will query each table and then merges the resultsets,
probably by concatenating them. Each resultset on itself is then ordered by description.

Roger Janssen
iBanx 

-----Original Message-----
From: drsla@tiscali.it [mailto:drsla@tiscali.it] 
Sent: Thursday, November 20, 2008 10:14 AM
To: ojb-user@db.apache.org
Subject: Query against an interface

Hi list,
I have a question regarding queries against an interface.
In
my application I have an interface with 2 subclasses. The interface has a "description" field.

	/*
	 * @ojb.field name="description"
	 * 	jdbc-
type="VARCHAR"
	 * 	length="300"
	 */
	public String getDescription();



When I build a query and I order it by description, all is fine if the query is against a
single subclass.
If the query is against the
interface, I have these results:
- first subclass results ordered by
description, then
- second subclass results ordered by description

Is
there a way to have all results ordered by description, and not each subclass results ordered
by description?
Any hint would be greatly
appreciated.
Thanks in advance and best regards,
Marco


_______________________________________________________________



Telefona e naviga senza limiti con Tiscali Voce 8 Mega a soli â‚¬ 15 al mese per 1 ANNO. In
seguito paghi â‚¬ 29,90 al mese. Attiva entro il 20/11/08! http://abbonati.tiscali.it/promo/voce8mega/

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org 
 
************************************************************************* 
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication
without the authority of iBanx bv. iBanx bv is neither liable for the
proper and complete transmission of the information has been maintained
nor that the communication is free of viruses, interceptions or
interference.  
 
If you are not the intended recipient of this communication please return
the communication to the sender and delete and destroy all copies.  



</pre>
</div>
</content>
</entry>
<entry>
<title>Query against an interface</title>
<author><name>&quot;drsla@tiscali.it&quot; &lt;drsla@tiscali.it&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200811.mbox/%3c24989301.75441227172424977.JavaMail.defaultUser@defaultHost%3e"/>
<id>urn:uuid:%3c24989301-75441227172424977-JavaMail-defaultUser@defaultHost%3e</id>
<updated>2008-11-20T09:13:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi list,
I have a question regarding queries against an interface.
In 
my application I have an interface with 2 subclasses. The interface has 
a "description" field.

	/*
	 * @ojb.field name="description"
	 * 	jdbc-
type="VARCHAR"
	 * 	length="300"
	 */
	public String getDescription();



When I build a query and I order it by description, all is fine if the 
query is against a single subclass.
If the query is against the 
interface, I have these results:
- first subclass results ordered by 
description, then
- second subclass results ordered by description

Is 
there a way to have all results ordered by description, and not each 
subclass results ordered by description?
Any hint would be greatly 
appreciated.
Thanks in advance and best regards,
Marco


_______________________________________________________________



Telefona e naviga senza limiti con Tiscali Voce 8 Mega a soli â‚¬ 15 al mese per 1 ANNO. In
seguito paghi â‚¬ 29,90 al mese. Attiva entro il 20/11/08! http://abbonati.tiscali.it/promo/voce8mega/

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>sql statements execution error</title>
<author><name>&quot;karthiksg.live&quot; &lt;karthiksg@live.in&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200811.mbox/%3cBAY108-DS19FE15058710CFCAD366AB71B0@phx.gbl%3e"/>
<id>urn:uuid:%3cBAY108-DS19FE15058710CFCAD366AB71B0@phx-gbl%3e</id>
<updated>2008-11-09T12:55:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hai,

I have a problem in doing an ant build

The sql statements throw

[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'CREATE TABLE Product ( id INTEGER NOT NULL, name VARCHAR (100),
price FLOAT, sto' at line 3

I want the ant script to create the database "productmanager" at runtime. I'm using MySQL
Server version 5.1.6

Below shown is my build.properties file:

jcdAlias=default
databaseName=productmanager
databaseUser=root
databasePassword=root

tomcat.home=${env.CATALINA_HOME}
tomcat.url=http://localhost:8080
tomcat.manager.url=${tomcat.url}/manager
# This user should be present in the $CATALINA_HOME/conf/tomcat-users.xml file with the role
'manager':
tomcat.username=tomcat
tomcat.password=tomcat

embeddedDatabase=false

dbmsName=MySQL
jdbcLevel=3.0
jdbcRuntimeDriver=com.mysql.jdbc.Driver
urlProtocol=jdbc
urlSubprotocol=mysql
urlDbalias=//localhost:3306/${databaseName}

torque.database=mysql

torque.database.createUrl=${urlProtocol}:${urlSubprotocol}://localhost:3306/${databaseName}

torque.database.driver=${jdbcRuntimeDriver}

torque.database.user=${databaseUser}

torque.database.password=${databasePassword}

torque.database.buildUrl=${torque.database.createUrl}

source.dir=src
source.java.dir=${source.dir}/java
source.resource.dir=${source.dir}/resources
source.test.dir=${source.dir}/test
source.schema.dir=${source.dir}/schema
source.webapp.dir=${source.dir}/webapp

build.dir=build
lib.dir=lib
lib.webapp.excludes=xdoclet*.jar,xjavadoc*.jar,torque*.jar,velocity*.jar

target.dir=target

servlet.lib=${tomcat.home}/common/lib/servlet-api.jar
jsp.lib=${tomcat.home}/common/lib/jsp-api.jar
deploy.dir=${tomcat.home}/webapps

embedded.database.excludes=*schema.xml,*.sql,*.sql.generation,sqldb.map



Below shown is the log details: (see the highlighted text in red color)

C:\Users\karthiksg\Desktop\webapp-sample\webapp-sample&gt;ant
Buildfile: build.xml

compile:

xdoclet:
[ojbdoclet] 2008-11-09 17:51:00,188 [main] INFO  xdoclet.XDocletMain.start - Run
ning &lt;ojbrepository/&gt;
[ojbdoclet] 2008-11-09 17:51:00,783 [main] INFO  xdoclet.XDocletMain.start - Run
ning &lt;torqueschema/&gt;

war:

compile:

xdoclet:
[ojbdoclet] 2008-11-09 17:51:02,105 [main] INFO  xdoclet.XDocletMain.start - Run
ning &lt;ojbrepository/&gt;
[ojbdoclet] 2008-11-09 17:51:02,604 [main] INFO  xdoclet.XDocletMain.start - Run
ning &lt;torqueschema/&gt;

setup-db:

check-use-classpath:

check-run-only-on-schema-change:

sql-check:

sql:
     [echo] +------------------------------------------+
     [echo] |                                          |
     [echo] | Generating SQL for YOUR Torque project!  |
     [echo] |                                          |
     [echo] +------------------------------------------+

sql-classpath:
     [echo] loading templates from classpath
[torque-sql] Using contextProperties file: C:\Users\karthiksg\Desktop\webapp-sam
ple\webapp-sample\build.properties
[torque-sql] Using classpath
[torque-sql] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\webapp-
sample\build\database\report.productmanager.sql.generation
[torque-sql] 2008-11-09 17:51:04,499 [main] INFO  org.apache.torque.engine.datab
ase.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
[torque-sql] 2008-11-09 17:51:04,522 [main] INFO  org.apache.torque.engine.datab
ase.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.torque.
engine.database.transform' package
[torque-sql] 2008-11-09 17:51:04,595 [main] INFO  org.apache.torque.engine.datab
ase.transform.XmlToAppData - Parsing file: 'project-schema.xml'
[torque-sql] 2008-11-09 17:51:04,600 [main] INFO  org.apache.torque.engine.datab
ase.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/dtd/data
base_3_0_1.dtd'

sql-template:

create-db-check:

create-db:
[torque-data-model] Using classpath
[torque-data-model] Generating to file C:\Users\karthiksg\Desktop\webapp-sample\
webapp-sample\build\database\create-db.sql
[torque-data-model] 2008-11-09 17:51:25,378 [main] INFO  org.apache.torque.engin
e.database.transform.XmlToAppData - Parsing file: 'ojbcore-schema.xml'
[torque-data-model] 2008-11-09 17:51:25,392 [main] INFO  org.apache.torque.engin
e.database.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.
torque.engine.database.transform' package
[torque-data-model] 2008-11-09 17:51:25,457 [main] INFO  org.apache.torque.engin
e.database.transform.XmlToAppData - Parsing file: 'project-schema.xml'
[torque-data-model] 2008-11-09 17:51:25,463 [main] INFO  org.apache.torque.engin
e.database.transform.DTDResolver - Resolver: used 'http://db.apache.org/torque/d
td/database_3_0_1.dtd'

shutdown-check:

append-shutdown-sql:
     [echo]
     [echo]       Executing the create-db.sql script ...
     [echo]
      [sql] Executing resource: C:\Users\karthiksg\Desktop\webapp-sample\webapp-
sample\build\database\create-db.sql
      [sql] 2 of 2 SQL statements executed successfully

insert-sql:

shutdown-check:

add-shutdown-sql-file:
[torque-sql-exec] Our new url -&gt; jdbc:mysql://localhost:3306/productmanager
[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
p-sample\build\database\project-schema.sql
[torque-sql-exec] Failed to execute: # -----------------------------------------
------------------------------
[torque-sql-exec]  # Product # -------------------------------------------------
----------------------
[torque-sql-exec]  drop table if exists Product; CREATE TABLE Product ( id INTEG
ER NOT NULL, name VARCHAR (100), price FLOAT, stock INTEGER, PRIMARY KEY(id) );
[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
 have an error in your SQL syntax; check the manual that corresponds to your MyS
QL server version for the right syntax to use near 'CREATE TABLE Product ( id IN
TEGER NOT NULL, name VARCHAR (100), price FLOAT, sto' at line 3
[torque-sql-exec] Executing file: C:\Users\karthiksg\Desktop\webapp-sample\webap
p-sample\build\database\ojbcore-schema.sql
[torque-sql-exec] Failed to execute: # -----------------------------------------
------------------------------
[torque-sql-exec]  # OJB_HL_SEQ # ----------------------------------------------
-------------------------
[torque-sql-exec]  drop table if exists OJB_HL_SEQ; CREATE TABLE OJB_HL_SEQ ( TA
BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB_SIZE INTEGER, VERSION INTEG
ER, PRIMARY KEY(TABLENAME) ); # ------------------------------------------------
-----------------------
[torque-sql-exec]  # OJB_NRM # -------------------------------------------------
----------------------
[torque-sql-exec]  drop table if exists OJB_NRM; CREATE TABLE OJB_NRM ( NAME VAR
CHAR (250) NOT NULL, OID_ LONGBLOB, PRIMARY KEY(NAME) ); # ---------------------
--------------------------------------------------
[torque-sql-exec]  # OJB_DLIST # -----------------------------------------------
------------------------
[torque-sql-exec]  drop table if exists OJB_DLIST; CREATE TABLE OJB_DLIST ( ID I
NTEGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # ---------------------------
--------------------------------------------
[torque-sql-exec]  # OJB_DLIST_ENTRIES # ---------------------------------------
--------------------------------
[torque-sql-exec]  drop table if exists OJB_DLIST_ENTRIES; CREATE TABLE OJB_DLIS
T_ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, O
ID_ LONGBLOB, PRIMARY KEY(ID) ); # ---------------------------------------------
--------------------------
[torque-sql-exec]  # OJB_DSET # ------------------------------------------------
-----------------------
[torque-sql-exec]  drop table if exists OJB_DSET; CREATE TABLE OJB_DSET ( ID INT
EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
------------------------------------------
[torque-sql-exec]  # OJB_DSET_ENTRIES # ----------------------------------------
-------------------------------
[torque-sql-exec]  drop table if exists OJB_DSET_ENTRIES; CREATE TABLE OJB_DSET_
ENTRIES ( ID INTEGER NOT NULL, DLIST_ID INTEGER NOT NULL, POSITION_ INTEGER, OID
_ LONGBLOB, PRIMARY KEY(ID) ); # -----------------------------------------------
------------------------
[torque-sql-exec]  # OJB_DMAP # ------------------------------------------------
-----------------------
[torque-sql-exec]  drop table if exists OJB_DMAP; CREATE TABLE OJB_DMAP ( ID INT
EGER NOT NULL, SIZE_ INTEGER, PRIMARY KEY(ID) ); # -----------------------------
------------------------------------------
[torque-sql-exec]  # OJB_DMAP_ENTRIES # ----------------------------------------
-------------------------------
[torque-sql-exec]  drop table if exists OJB_DMAP_ENTRIES; CREATE TABLE OJB_DMAP_
ENTRIES ( ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KEY_OID LONGBLOB, VALUE
_OID LONGBLOB, PRIMARY KEY(ID) );
[torque-sql-exec] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
 have an error in your SQL syntax; check the manual that corresponds to your MyS
QL server version for the right syntax to use near 'CREATE TABLE OJB_HL_SEQ ( TA
BLENAME VARCHAR (250) NOT NULL, MAX_KEY BIGINT, GRAB' at line 3
[torque-sql-exec] 0 of 2 SQL statements executed successfully

copy-database-files:

BUILD SUCCESSFUL
Total time: 46 seconds

I can see the files build\database\createdb.sql ,
                           build\database\ojbcore-schema.sql ,
                           build\database\project-schema.sql 

I can copy the statements from the .sql listed above and execute successfully in mysql command
window.

kindly do the needfull.


 

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: question about synchronization in 1:n relationships</title>
<author><name>&quot;Alessandro Colantoni&quot; &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200810.mbox/%3c59f42c000810240743u7963c2fl13de17f3bbe2fe15@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000810240743u7963c2fl13de17f3bbe2fe15@mail-gmail-com%3e</id>
<updated>2008-10-24T14:43:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Abid
About the refresh-attribute, I think you well understood, even if I never
used it. Anyway it should be easy to try.
The two level is not a performance improvement, but it is more that other
that the change you make on the cache can be seen by other user when you end
up the transaction, (persistencebroker.close,  or commit or so on...)

About the synchronization you need, I don't know... I always deal with the
opposite problem. I generally don't want that changes in cache on a side can
influence my job on an other side, until is all finished.

I think that when you lookup something from the cache a new object is
created copying information from the cache. Then it is your own object and
you can do whatever you want on it. Nothing reference the cache. I think
that is the way it works, anyway I never considered your needing.
Anyway with Ojb it is very easy to make your own cache
http://db.apache.org/ojb/docu/guides/objectcache.html#More+implementations+.
..
more ... in the package *org.apache.ojb.broker.cache*  there are more cache
implementation and you could be lucky.
So browse in this package in the source code  and javadoc. If you find out
something tell me. It could be interesting.

Regards

Alessandro




On Fri, Oct 24, 2008 at 3:52 PM, Abid Hussain &lt;abid.hussain@abid76.de&gt;wrote:

&gt; Hi,
&gt;
&gt; first of all, thanks for help and giving me the hints to the docs.
&gt;
&gt; My goal is to avoid keeping objects in my application which are
&gt; unsynchronized with the db.
&gt;
&gt; So far I understood setting the refresh-attribute in collection-descriptor
&gt; to "true" results in refreshing all referenced objects in the collection
&gt; when the object is loaded from cache or database.
&gt;
&gt; Whereas using the two-level-cache only is a performance improvement to keep
&gt; the number of db-lookups small. It doesn't prevent the application from
&gt; having unsynchronized data.
&gt;
&gt; Maybe you could give me a hint if my conclusions described above are
&gt; correct in termns of understanding how refresh and two-level-cache works?
&gt;
&gt; Regards,
&gt;
&gt; Abid
&gt;
&gt; Alessandro Colantoni schrieb:
&gt;
&gt;  Hi Abid.
&gt;&gt;
&gt;&gt; Do you mean that you want automatically refreshed the events collection,
&gt;&gt; without any lookup to the cache or not?.
&gt;&gt;
&gt;&gt; If you want the collection to be refreshed on look up you can
&gt;&gt; use collection-descriptor refresh attribute or the two level cache
&gt;&gt; http://db.apache.org/ojb/docu/guides/repository.html#collection-descriptor
&gt;&gt; http://db.apache.org/ojb/docu/guides/objectcache.html#two-level
&gt;&gt;
&gt;&gt; I dont't think you could avoid a lookup, anyway a first idea could be to
&gt;&gt; make it hidden to the eventType user.
&gt;&gt; For example you could hide the lookup in the method getEvents of the class
&gt;&gt; EventType
&gt;&gt;
&gt;&gt; Regards
&gt;&gt; Alessandro
&gt;&gt;
&gt;&gt;
&gt;&gt; On Wed, Oct 22, 2008 at 10:00 AM, Abid Hussain &lt;abid.hussain@abid76.de
&gt;&gt; &gt;wrote:
&gt;&gt;
&gt;&gt;  Hello everybody,
&gt;&gt;&gt;
&gt;&gt;&gt; I except not to be the first one to ask this question, but haven't found
&gt;&gt;&gt; anything in the archives.
&gt;&gt;&gt;
&gt;&gt;&gt; My question is about synchronization resp. caching of 1:n relations.
&gt;&gt;&gt; Let's
&gt;&gt;&gt; say, we have two entities:
&gt;&gt;&gt; class Event {
&gt;&gt;&gt;       int id;
&gt;&gt;&gt;       int eventTypeId;
&gt;&gt;&gt;       EventType eventType;
&gt;&gt;&gt;       // ... other fields
&gt;&gt;&gt; }
&gt;&gt;&gt; class EventType {
&gt;&gt;&gt;       int id;
&gt;&gt;&gt;       Collection&lt;Event&gt; events;
&gt;&gt;&gt;       // ... other fields
&gt;&gt;&gt; }
&gt;&gt;&gt; So, there is a 1:n relationship between EventType and Event - EventType
&gt;&gt;&gt; is
&gt;&gt;&gt; on the 1-side and Event is on the n-side.
&gt;&gt;&gt;
&gt;&gt;&gt; Let's look at the following:
&gt;&gt;&gt; (1) We fetch an EventType (called evType) from DB incl. all the
&gt;&gt;&gt; associated
&gt;&gt;&gt; Events.
&gt;&gt;&gt; (2) Another user deletes an Event from the DB which was associated with
&gt;&gt;&gt; the
&gt;&gt;&gt; previously fetched EventType.
&gt;&gt;&gt; (3) At this point, an Event is included in the evType's events-collection
&gt;&gt;&gt; which doesn't exist any more cause it was deleted in (2).
&gt;&gt;&gt;
&gt;&gt;&gt; Is there any caching or synchronization mechanism to avoid the problem in
&gt;&gt;&gt; (3)?
&gt;&gt;&gt;
&gt;&gt;&gt; Regards,
&gt;&gt;&gt;
&gt;&gt;&gt; Abid
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt;
&gt;&gt;&gt; Abid Hussain
&gt;&gt;&gt; Mail: abid.hussain@abid76.de
&gt;&gt;&gt; Web: http://www.abid76.de
&gt;&gt;&gt;
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt;&gt;&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt; --
&gt;
&gt; Abid Hussain
&gt; Mail: abid.hussain@abid76.de
&gt; Web: http://www.abid76.de
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: question about synchronization in 1:n relationships</title>
<author><name>Abid Hussain &lt;abid.hussain@abid76.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200810.mbox/%3c4901D302.3030303@abid76.de%3e"/>
<id>urn:uuid:%3c4901D302-3030303@abid76-de%3e</id>
<updated>2008-10-24T13:52:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

first of all, thanks for help and giving me the hints to the docs.

My goal is to avoid keeping objects in my application which are unsynchronized 
with the db.

So far I understood setting the refresh-attribute in collection-descriptor to 
"true" results in refreshing all referenced objects in the collection when the 
object is loaded from cache or database.

Whereas using the two-level-cache only is a performance improvement to keep the 
number of db-lookups small. It doesn't prevent the application from having 
unsynchronized data.

Maybe you could give me a hint if my conclusions described above are correct in 
termns of understanding how refresh and two-level-cache works?

Regards,

Abid

Alessandro Colantoni schrieb:
&gt; Hi Abid.
&gt; 
&gt; Do you mean that you want automatically refreshed the events collection,
&gt; without any lookup to the cache or not?.
&gt; 
&gt; If you want the collection to be refreshed on look up you can
&gt; use collection-descriptor refresh attribute or the two level cache
&gt; http://db.apache.org/ojb/docu/guides/repository.html#collection-descriptor
&gt; http://db.apache.org/ojb/docu/guides/objectcache.html#two-level
&gt; 
&gt; I dont't think you could avoid a lookup, anyway a first idea could be to
&gt; make it hidden to the eventType user.
&gt; For example you could hide the lookup in the method getEvents of the class
&gt; EventType
&gt; 
&gt; Regards
&gt; Alessandro
&gt; 
&gt; 
&gt; On Wed, Oct 22, 2008 at 10:00 AM, Abid Hussain &lt;abid.hussain@abid76.de&gt;wrote:
&gt; 
&gt;&gt; Hello everybody,
&gt;&gt;
&gt;&gt; I except not to be the first one to ask this question, but haven't found
&gt;&gt; anything in the archives.
&gt;&gt;
&gt;&gt; My question is about synchronization resp. caching of 1:n relations. Let's
&gt;&gt; say, we have two entities:
&gt;&gt; class Event {
&gt;&gt;        int id;
&gt;&gt;        int eventTypeId;
&gt;&gt;        EventType eventType;
&gt;&gt;        // ... other fields
&gt;&gt; }
&gt;&gt; class EventType {
&gt;&gt;        int id;
&gt;&gt;        Collection&lt;Event&gt; events;
&gt;&gt;        // ... other fields
&gt;&gt; }
&gt;&gt; So, there is a 1:n relationship between EventType and Event - EventType is
&gt;&gt; on the 1-side and Event is on the n-side.
&gt;&gt;
&gt;&gt; Let's look at the following:
&gt;&gt; (1) We fetch an EventType (called evType) from DB incl. all the associated
&gt;&gt; Events.
&gt;&gt; (2) Another user deletes an Event from the DB which was associated with the
&gt;&gt; previously fetched EventType.
&gt;&gt; (3) At this point, an Event is included in the evType's events-collection
&gt;&gt; which doesn't exist any more cause it was deleted in (2).
&gt;&gt;
&gt;&gt; Is there any caching or synchronization mechanism to avoid the problem in
&gt;&gt; (3)?
&gt;&gt;
&gt;&gt; Regards,
&gt;&gt;
&gt;&gt; Abid
&gt;&gt;
&gt;&gt;
&gt;&gt; --
&gt;&gt;
&gt;&gt; Abid Hussain
&gt;&gt; Mail: abid.hussain@abid76.de
&gt;&gt; Web: http://www.abid76.de
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt;&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;&gt;
&gt;&gt;
&gt; 

-- 

Abid Hussain
Mail: abid.hussain@abid76.de
Web: http://www.abid76.de


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: question about synchronization in 1:n relationships</title>
<author><name>&quot;Alessandro Colantoni&quot; &lt;alessandro.colantoni@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200810.mbox/%3c59f42c000810230444g341f052fr1c4975a6e0720e73@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59f42c000810230444g341f052fr1c4975a6e0720e73@mail-gmail-com%3e</id>
<updated>2008-10-23T11:44:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Abid.

Do you mean that you want automatically refreshed the events collection,
without any lookup to the cache or not?.

If you want the collection to be refreshed on look up you can
use collection-descriptor refresh attribute or the two level cache
http://db.apache.org/ojb/docu/guides/repository.html#collection-descriptor
http://db.apache.org/ojb/docu/guides/objectcache.html#two-level

I dont't think you could avoid a lookup, anyway a first idea could be to
make it hidden to the eventType user.
For example you could hide the lookup in the method getEvents of the class
EventType

Regards
Alessandro


On Wed, Oct 22, 2008 at 10:00 AM, Abid Hussain &lt;abid.hussain@abid76.de&gt;wrote:

&gt; Hello everybody,
&gt;
&gt; I except not to be the first one to ask this question, but haven't found
&gt; anything in the archives.
&gt;
&gt; My question is about synchronization resp. caching of 1:n relations. Let's
&gt; say, we have two entities:
&gt; class Event {
&gt;        int id;
&gt;        int eventTypeId;
&gt;        EventType eventType;
&gt;        // ... other fields
&gt; }
&gt; class EventType {
&gt;        int id;
&gt;        Collection&lt;Event&gt; events;
&gt;        // ... other fields
&gt; }
&gt; So, there is a 1:n relationship between EventType and Event - EventType is
&gt; on the 1-side and Event is on the n-side.
&gt;
&gt; Let's look at the following:
&gt; (1) We fetch an EventType (called evType) from DB incl. all the associated
&gt; Events.
&gt; (2) Another user deletes an Event from the DB which was associated with the
&gt; previously fetched EventType.
&gt; (3) At this point, an Event is included in the evType's events-collection
&gt; which doesn't exist any more cause it was deleted in (2).
&gt;
&gt; Is there any caching or synchronization mechanism to avoid the problem in
&gt; (3)?
&gt;
&gt; Regards,
&gt;
&gt; Abid
&gt;
&gt;
&gt; --
&gt;
&gt; Abid Hussain
&gt; Mail: abid.hussain@abid76.de
&gt; Web: http://www.abid76.de
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
&gt; For additional commands, e-mail: ojb-user-help@db.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>question about synchronization in 1:n relationships</title>
<author><name>Abid Hussain &lt;abid.hussain@abid76.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200810.mbox/%3c48FEDD8C.10009@abid76.de%3e"/>
<id>urn:uuid:%3c48FEDD8C-10009@abid76-de%3e</id>
<updated>2008-10-22T08:00:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello everybody,

I except not to be the first one to ask this question, but haven't found 
anything in the archives.

My question is about synchronization resp. caching of 1:n relations. Let's say, 
we have two entities:
class Event {
	int id;
	int eventTypeId;
	EventType eventType;
	// ... other fields
}
class EventType {
	int id;
	Collection&lt;Event&gt; events;
	// ... other fields
}
So, there is a 1:n relationship between EventType and Event - EventType is on 
the 1-side and Event is on the n-side.

Let's look at the following:
(1) We fetch an EventType (called evType) from DB incl. all the associated Events.
(2) Another user deletes an Event from the DB which was associated with the 
previously fetched EventType.
(3) At this point, an Event is included in the evType's events-collection which 
doesn't exist any more cause it was deleted in (2).

Is there any caching or synchronization mechanism to avoid the problem in (3)?

Regards,

Abid


-- 

Abid Hussain
Mail: abid.hussain@abid76.de
Web: http://www.abid76.de

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Stability</title>
<author><name>johne &lt;jeichels@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/db-ojb-user/200810.mbox/%3c19892412.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c19892412-post@talk-nabble-com%3e</id>
<updated>2008-10-09T04:56:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Still definitely having a problem.

1.0.4 is working.  I got my pom files to pull in the dependencies
automatically.  Originally I had them be different between 1.0.4, but I
tried having them be the same this time.  The only difference is the
repository.dtd, repository-internal.xml, OJB.properties, and
OJB-logging.xml, and the actual ojb jar file.  There are no library
duplications.

When I move my pom.xml up to 1.0.5 I still get:
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast
to java.lang.Long

On the line for:
    count = new Integer(((Long)obj[2]).intValue());

After adding the following lines that are in line for what you suggested:
   String[] crColumns = new String[]{"countryId", "regionId",
"count(countryId)", "count(regionId)"};
   int[] crTypes = new int[]{Types.VARCHAR, Types.VARCHAR, Types.BIGINT,
Types.BIGINT};

The added line works fine in 1.0.4, but does not seem to affect the outcome
in 1.0.5.  I do add different criteria to the query, but I don't see how
they could affect the result set type.

countryId and regionId are both VARCHARs.  Could it be that since they are
VARCHARs that it may put the count as a VARCHAR?   Maybe I can try to hunt
around OJB code, but I think there might have been a change that was put
into OJB after the RC1 that had to do with count().

I had not yet been able to find those libraries yet required to compile OJB
though.

Have to think about this more.  Hopefully have more time for it this
weekend.  In the meantime, we went up into production with 1.0.4 as we
wanted to release quick.

Now we have a document repository and can give people some value added.


-----
JohnE

http://jobbank.com/ jobbank.com 
-- 
View this message in context: http://www.nabble.com/Stability-tp19785653p19892412.html
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



</pre>
</div>
</content>
</entry>
</feed>
