Re: OJB-JDO why sequence increment in retrieve

2005-05-19 Thread Armin Waibel
Alessandro Vincelli wrote:
Ok,  I'am trying in other ways,
but I have other problems.
Can you hel me in a correct
...
Identity oid = new Identity(e, broker);
...
b = (Utenti) persistenceManager.getObjectById(oid, false);
...
thanks in advance
To create Identity objects you should use
Identity oid = broker.serviceIdentity().buildIdentity(...)
this method allows to build Identity objects based on a object itself or
on the used PK.
If you want to use JDO-api in production environment I recommend to use
JPOX, because OJB-JDO is only a prototype based on jdori (JDO2.0 will be
supported in OJB2.0).
regards,
Armin

Armin Waibel ha scritto:
Hi Alessandro,
Alessandro Vincelli wrote:

I use this simple code to retrieve row,
but after this code the db sequence of Utenti table is autoincrement.
Why?
Thanks,Ale
//1. Get the PersistenceManager
   PersistenceManager persistenceManager =
jdo.getPersistenceManager();
   Utenti e = new Utenti();
   e.setId_utente(bean.getId_utente());
   PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
   Identity oid = new Identity(e, broker);

When you create an Identity object for a new (not persisted) object, OJB
try to lookup/set a valid PK for the object, thus the sequence will be
incremented (because the PK is null and OJB lookup a valid sequence for
the new object).
regards,
Armin

   Utenti b = new Utenti();
   //2. start transaction
   persistenceManager.currentTransaction().begin();
   // 3. Get the Object based on the primary key
   b = (Utenti) persistenceManager.getObjectById(oid, false);
   // 4. Copy data to bean
   copyData(b, bean);
   // 5. End transaction
   persistenceManager.currentTransaction().commit();
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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



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


Re: OJB-JDO why sequence increment in retrieve

2005-05-19 Thread Alessandro Vincelli
Ok,  I'am trying in other ways,
but I have other problems.
Can you hel me in a correct
...
Identity oid = new Identity(e, broker);
...
b = (Utenti) persistenceManager.getObjectById(oid, false);
...
thanks in advance


Armin Waibel ha scritto:
> Hi Alessandro,
> 
> Alessandro Vincelli wrote:
> 
>> I use this simple code to retrieve row,
>> but after this code the db sequence of Utenti table is autoincrement.
>> Why?
>> Thanks,Ale
>>
>>
>>  //1. Get the PersistenceManager
>> PersistenceManager persistenceManager =
>> jdo.getPersistenceManager();
>> Utenti e = new Utenti();
>> e.setId_utente(bean.getId_utente());
>> PersistenceBroker broker =
>> PersistenceBrokerFactory.defaultPersistenceBroker();
>> Identity oid = new Identity(e, broker);
> 
> 
> When you create an Identity object for a new (not persisted) object, OJB
> try to lookup/set a valid PK for the object, thus the sequence will be
> incremented (because the PK is null and OJB lookup a valid sequence for
> the new object).
> 
> regards,
> Armin
> 
> 
>> Utenti b = new Utenti();
>> //2. start transaction
>> persistenceManager.currentTransaction().begin();
>> // 3. Get the Object based on the primary key
>> b = (Utenti) persistenceManager.getObjectById(oid, false);
>> // 4. Copy data to bean
>> copyData(b, bean);
>> // 5. End transaction
>> persistenceManager.currentTransaction().commit();
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
---
Alessandro Vincelli
E-mail: [EMAIL PROTECTED]
tel: +39 339 8695546


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-18 Thread Martin Kalén
Alessandro Vincelli wrote:
I have tried, but I have had great problems.
Tomcat always says:
Message: Scheduler with name 'Cocoon' already exists.
This is only the effect of a previous error.
Cocoon has the following web.xml configuration:
 1
This means that Tomcat will load Cocoon at Tomcat start (as opposed to first
access of CocoonServlet).
If CocoonServlet throws an exception during init, Tomcat will consider the
servlet as uninitialized and will try to re-init on first access.
Ie one "half-init + break" + another "half-init + break", which gives you
troubles with anything loaded statically in the JVM during the part of the
init that actually works (eg configuring the Cron block and Quartz scheduler).
You should search for the previous error in the Tomcat and/or Cocoon logs
and try to get help on the Cocoon user's list (don't focus on the
"cannot create a quartz scheduler", during testing it might also be
easier to set load-on-startup=0 in Cocoon's web.xml).
You can use Tomcat's Manager application [1] to check the init-status
and if Tomcat considers the servlet to be loaded.
HTH,
 Martin
[1] http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB-JDO why sequence increment in retrieve

2005-05-12 Thread Armin Waibel
Hi Alessandro,
Alessandro Vincelli wrote:
I use this simple code to retrieve row,
but after this code the db sequence of Utenti table is autoincrement.
Why?
Thanks,Ale
 //1. Get the PersistenceManager
PersistenceManager persistenceManager = jdo.getPersistenceManager();
Utenti e = new Utenti();
e.setId_utente(bean.getId_utente());
PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
Identity oid = new Identity(e, broker);
When you create an Identity object for a new (not persisted) object, OJB 
try to lookup/set a valid PK for the object, thus the sequence will be 
incremented (because the PK is null and OJB lookup a valid sequence for 
the new object).

regards,
Armin

Utenti b = new Utenti();
//2. start transaction
persistenceManager.currentTransaction().begin();
// 3. Get the Object based on the primary key
b = (Utenti) persistenceManager.getObjectById(oid, false);
// 4. Copy data to bean
copyData(b, bean);
// 5. End transaction
persistenceManager.currentTransaction().commit();
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Re: OJB-JDO why sequence increment in retrieve

2005-05-09 Thread Alessandro Vincelli

I have tried, but I have had great problems.

Tomcat always says:


Message: Scheduler with name 'Cocoon' already exists.

Description:
org.apache.avalon.framework.configuration.ConfigurationException: cannot
create a quartz scheduler

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet




Antonio Gallardo wrote:

>On Mar, 10 de Mayo de 2005, 12:28, Alessandro Vincelli dijo:
>  
>
>>Hi
>>
>>I have a problem to include db-ojb1.0.3
>>in Cocoon 2.1.7 build with jdk.1.5
>>
>>
>
>  
>
>>Can I compile  db-ojb1.0.3  with jdk.1.5 and include this in Cocoon?
>>
>>
>
>I guess yes. I will try to add this to the cocoon svn today night.
>
>Best Regards,
>
>Antonio Gallardo
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
>


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-09 Thread Antonio Gallardo
On Mar, 10 de Mayo de 2005, 12:28, Alessandro Vincelli dijo:
> Hi
>
> I have a problem to include db-ojb1.0.3
> in Cocoon 2.1.7 build with jdk.1.5

> Can I compile  db-ojb1.0.3  with jdk.1.5 and include this in Cocoon?

I guess yes. I will try to add this to the cocoon svn today night.

Best Regards,

Antonio Gallardo


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-09 Thread Antonio Gallardo
On Lun, 9 de Mayo de 2005, 2:45, Alessandro Vincelli dijo:
> I use  db-ojb-1.0.1 with cocoon 2.1.7
>
> Can i try the new latest release with cocoon?

Yep.

> Thanks a lot Gallardo
>
> I use with great  satisfaction Druid.  I have read all what you have
> made on OJB/JDO/CForms.

:-) I am glad to hear that!

Best Regards,

Antonio Gallardo


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-09 Thread Alessandro Vincelli
Hi

I have a problem to include db-ojb1.0.3
in Cocoon 2.1.7 build with jdk.1.5

Can I compile  db-ojb1.0.3  with jdk.1.5 and include this in Cocoon?

Thanks a lot





I receive this message:


  Initialization Problem

Message: Scheduler with name 'Cocoon' already exists.

Description:
org.apache.avalon.framework.configuration.ConfigurationException: cannot
create a quartz scheduler

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

cause

org.quartz.SchedulerException: Scheduler with name 'Cocoon' already exists.









Antonio Gallardo wrote:

>Hi:
>
>
>Please provide the OJB version you use. AFAIK, it was already fixed for
>non JDO API's.
>
>Best Regards,
>
>Antonio Gallardo
>
>On Lun, 9 de Mayo de 2005, 18:15, Alessandro Vincelli dijo:
>  
>
>>I use this simple code to retrieve row,
>>but after this code the db sequence of Utenti table is autoincrement.
>>Why?
>>Thanks,Ale
>>
>>
>> //1. Get the PersistenceManager
>>PersistenceManager persistenceManager =
>>jdo.getPersistenceManager();
>>Utenti e = new Utenti();
>>e.setId_utente(bean.getId_utente());
>>PersistenceBroker broker =
>>PersistenceBrokerFactory.defaultPersistenceBroker();
>>Identity oid = new Identity(e, broker);
>>Utenti b = new Utenti();
>>//2. start transaction
>>persistenceManager.currentTransaction().begin();
>>// 3. Get the Object based on the primary key
>>b = (Utenti) persistenceManager.getObjectById(oid, false);
>>// 4. Copy data to bean
>>copyData(b, bean);
>>// 5. End transaction
>>persistenceManager.currentTransaction().commit();
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
>


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-09 Thread Alessandro Vincelli
I use  db-ojb-1.0.1 with cocoon 2.1.7

Can i try the new latest release with cocoon?

Thanks a lot Gallardo

I use with great  satisfaction Druid.  I have read all what you have
made on OJB/JDO/CForms.




Antonio Gallardo ha scritto:
> Hi:
> 
> 
> Please provide the OJB version you use. AFAIK, it was already fixed for
> non JDO API's.
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> On Lun, 9 de Mayo de 2005, 18:15, Alessandro Vincelli dijo:
> 
>>I use this simple code to retrieve row,
>>but after this code the db sequence of Utenti table is autoincrement.
>>Why?
>>Thanks,Ale
>>
>>
>> //1. Get the PersistenceManager
>>PersistenceManager persistenceManager =
>>jdo.getPersistenceManager();
>>Utenti e = new Utenti();
>>e.setId_utente(bean.getId_utente());
>>PersistenceBroker broker =
>>PersistenceBrokerFactory.defaultPersistenceBroker();
>>Identity oid = new Identity(e, broker);
>>Utenti b = new Utenti();
>>//2. start transaction
>>persistenceManager.currentTransaction().begin();
>>// 3. Get the Object based on the primary key
>>b = (Utenti) persistenceManager.getObjectById(oid, false);
>>// 4. Copy data to bean
>>copyData(b, bean);
>>// 5. End transaction
>>persistenceManager.currentTransaction().commit();
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
---
Alessandro Vincelli
E-mail: [EMAIL PROTECTED]
tel: +39 339 8695546


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



Re: OJB-JDO why sequence increment in retrieve

2005-05-08 Thread Antonio Gallardo
Hi:


Please provide the OJB version you use. AFAIK, it was already fixed for
non JDO API's.

Best Regards,

Antonio Gallardo

On Lun, 9 de Mayo de 2005, 18:15, Alessandro Vincelli dijo:
> I use this simple code to retrieve row,
> but after this code the db sequence of Utenti table is autoincrement.
> Why?
> Thanks,Ale
>
>
>  //1. Get the PersistenceManager
> PersistenceManager persistenceManager =
> jdo.getPersistenceManager();
> Utenti e = new Utenti();
> e.setId_utente(bean.getId_utente());
> PersistenceBroker broker =
> PersistenceBrokerFactory.defaultPersistenceBroker();
> Identity oid = new Identity(e, broker);
> Utenti b = new Utenti();
> //2. start transaction
> persistenceManager.currentTransaction().begin();
> // 3. Get the Object based on the primary key
> b = (Utenti) persistenceManager.getObjectById(oid, false);
> // 4. Copy data to bean
> copyData(b, bean);
> // 5. End transaction
> persistenceManager.currentTransaction().commit();
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



OJB-JDO why sequence increment in retrieve

2005-05-08 Thread Alessandro Vincelli
I use this simple code to retrieve row,
but after this code the db sequence of Utenti table is autoincrement.
Why?
Thanks,Ale


 //1. Get the PersistenceManager
PersistenceManager persistenceManager = jdo.getPersistenceManager();
Utenti e = new Utenti();
e.setId_utente(bean.getId_utente());
PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
Identity oid = new Identity(e, broker);
Utenti b = new Utenti();
//2. start transaction
persistenceManager.currentTransaction().begin();
// 3. Get the Object based on the primary key
b = (Utenti) persistenceManager.getObjectById(oid, false);
// 4. Copy data to bean
copyData(b, bean);
// 5. End transaction
persistenceManager.currentTransaction().commit();

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



Re: OJB/JDO

2004-07-29 Thread Brian McCallister
On Jul 29, 2004, at 5:53 PM, Artur Z wrote:
thanks form reply
correct me if i'm wrong, but if everything will go as planed the 
apache JDO
implementation will be ready by november ?
That is my personal plan, not an official one, and is subject to the 
whims of the JDO expert group changing everything. In other words, it 
is a best guess on my part.

-Brian
Artur
- Original Message -
From: "Brian McCallister" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, July 29, 2004 11:27 PM
Subject: Re: OJB/JDO

On Jul 29, 2004, at 4:42 PM, Artur Z wrote:
hello
I searched the archive and I have not found answers so please tell 
me:

- is it still impossible to use OJB/JDO in production (because of the
sun's JDORI license) ?
Yes
- when apache implementation of JDO will be ready ?
Good question. We are working on this, but can always use help =) I
*hope* to have it production worthy and compliant with the JDO2 spec 
by
november.

- why JDO api is better than ODMG (I mean functionality, usability) ?
It does support a few things ODMG doesn't -- attach/detach, efficient
query by identity, explicit optimistic transaction support.
-Brian
only a few days left me for making decision about deep going into 
OJB,
so please help me found the answers

Best regards
Artur

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

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


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


Re: OJB/JDO

2004-07-29 Thread Artur Z
thanks form reply

correct me if i'm wrong, but if everything will go as planed the apache JDO
implementation will be ready by november ?

Artur

- Original Message -
From: "Brian McCallister" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, July 29, 2004 11:27 PM
Subject: Re: OJB/JDO


>
> On Jul 29, 2004, at 4:42 PM, Artur Z wrote:
>
> > hello
> >
> > I searched the archive and I have not found answers so please tell me:
> >
> > - is it still impossible to use OJB/JDO in production (because of the
> > sun's JDORI license) ?
>
> Yes
>
> > - when apache implementation of JDO will be ready ?
>
> Good question. We are working on this, but can always use help =) I
> *hope* to have it production worthy and compliant with the JDO2 spec by
> november.
>
> > - why JDO api is better than ODMG (I mean functionality, usability) ?
>
> It does support a few things ODMG doesn't -- attach/detach, efficient
> query by identity, explicit optimistic transaction support.
>
> -Brian
>
> >
> > only a few days left me for making decision about deep going into OJB,
> > so please help me found the answers
> >
> > Best regards
> >
> > Artur
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



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



Re: OJB/JDO

2004-07-29 Thread Brian McCallister
On Jul 29, 2004, at 4:42 PM, Artur Z wrote:
hello
I searched the archive and I have not found answers so please tell me:
- is it still impossible to use OJB/JDO in production (because of the 
sun's JDORI license) ?
Yes
- when apache implementation of JDO will be ready ?
Good question. We are working on this, but can always use help =) I 
*hope* to have it production worthy and compliant with the JDO2 spec by 
november.

- why JDO api is better than ODMG (I mean functionality, usability) ?
It does support a few things ODMG doesn't -- attach/detach, efficient 
query by identity, explicit optimistic transaction support.

-Brian
only a few days left me for making decision about deep going into OJB, 
so please help me found the answers

Best regards
Artur

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


OJB/JDO

2004-07-29 Thread Artur Z
hello

I searched the archive and I have not found answers so please tell me:

- is it still impossible to use OJB/JDO in production (because of the sun's JDORI 
license) ?
- when apache implementation of JDO will be ready ?
- why JDO api is better than ODMG (I mean functionality, usability) ?

only a few days left me for making decision about deep going into OJB, so please help 
me found the answers

Best regards

Artur

Re: Problem with OJB-JDO plugin and proxy classes

2004-05-04 Thread Brian McCallister
I believe, though lack first hand knowledge, that Thomas M. said the 
JDORI plugin doesn't work with proxies. That is its big drawback =(

-Brian

On May 4, 2004, at 4:16 AM, Alexandre BOISSEAU wrote:

Hi,

I have problems when using proxy class :
With the tutorial example :
Loading of Article objects for a given ProductGroup works correctly, 
but when I try to load Article objects only, the search always returns 
nothing. Removing proxy from Article class-descriptor fixes the 
problem (search works correctly). Any suggestions?

Thanks in advance,
Alexandre
--
Alexandre BOISSEAU
Université de Rennes1


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



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


Problem with OJB-JDO plugin and proxy classes

2004-05-04 Thread Alexandre BOISSEAU
Hi,

I have problems when using proxy class :
With the tutorial example :
Loading of Article objects for a given ProductGroup works correctly, but 
when I try to load Article objects only, the search always returns 
nothing. Removing proxy from Article class-descriptor fixes the problem 
(search works correctly). Any suggestions?

Thanks in advance,
Alexandre
--
Alexandre BOISSEAU
Université de Rennes1


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


Re: How to set up a ojb-jdo project

2003-12-10 Thread Gus Heck
This looks like a runtime error not a compile time error.

This exception means, as you guessed, that either you forgot to enhance 
the class (with the sun reference enhancer), or the enhancer tried and 
failed (you should get messages if it fails). Alternately, you have 
inadvertently tried to get an extent of some other class that isn't 
supposed to be persistant.

Do you get any error messages during enhancement?

Also, as always, check that your app is really getting re-deployed 
properly, and you arn't seeing errors from an old version that is still 
running. I use the Tomcat Manager App's Ant tasks for this, so I don't 
have to worry about making sure I delete the warfiles, and the expanded 
warfile, and I don't need to worry about whatever is in the work directory.

Also, you can eliminate repository_junit.xml and repository_internal.xml 
(and thier references in repository.xml)

I'm not sure how anything is working unless you have flattened the 
directory structure in your listing of files... the standard web ap 
directory structure is:

+--WEB-INF--+
|   +--classes/ <<< all class files in package dirs,
|   |  repository.xml & .dtd ,
|   |  OJB.properties plus
|   |  package.jdo/classname.jdo files
|   |  in appropriate dirs
|   +--lib/ <<< All library jars here
|   |  (db-ojb-1.0.rc4.jar, jdo.jar etc)
|   +--web.xml
+--index.jsp
+--staic-page.html
+--whatever-content-dirs/
Sourcefiles for your classes are not needed anywhere, and can be 
ommited. Taglib descriptor (.tld) files can go anywhere, as long as your 
pages specify their location correctly. I tend to put mine in /WEB-INF/lib.

Hope some of this helps, please create a new thread instead of replying 
to an existing one next time you have a new question. The way you did it 
you will only get seen by people who think "Newbie questions... please 
help" is an interesting subject, or who do not view thier mail as 
threads.You probably want the widest possible audience ;)

-Gus

Sebastian Münch wrote:

Hi,

we are in the middle of developing a small application using the jdo 
api on
ojb. The
tutorials are running fine, now we wanna setup our own app. By 
compiling our
application,
we get the following error:

[JDO] DEBUG: OjbStoreConnector.begin: connectionReadyForRelease=false
javax.jdo.JDOUserException: Class given to getExtent does not implement
javax.jdo.spi.PersistenceCapable
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
Source)
at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
Source)
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
at test.TestApp.run(TestApp.java:57)
at test.TestApp.main(TestApp.java:25)
Exception in thread "main" javax.jdo.JDOUserException: Cannot close
PersistenceManager while transaction is still active.
at com.sun.jdori.common.PersistenceManagerImpl.close(Unknown Source)
at
com.sun.jdori.common.PersistenceManagerImpl.popCurrentWrapper(Unknown
Source)
at com.sun.jdori.common.PersistenceManagerWrapper.close(Unknown
Source)
at test.TestApp.run(TestApp.java:76)
at test.TestApp.main(TestApp.java:25)

Our persistent class is HJSTest. We applied the HSJTest.jdo to our
Userclass. The
following files are located In our project directory:
HSJTest.jdo
OJB.properties
TestApp.class
TestApp.sh
Test_ClassDescriptor.xml
Test_ConnectionDescriptor.xml
Test_Repository.xml
cache.ccf
commons-logging.properties
jdo.dtd
log4j.properties
repository.dtd
repository.xml
repository_database.xml
repository_ejb.xml
repository_internal.xml
repository_jdo.xml
repository_junit.xml
repository_user.xml
simplelog.properties
spy.properties
test/

Our source code including compiled files are located in the test/ 
directory.



We believe, that there is a problem with the Enhancer, adding the
PersistenceCapable -
Interface to our Class. Can anybody help us on that sibject?
Thx,
Jing, Holger, Sebastian


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


How to set up a ojb-jdo project

2003-12-10 Thread "Sebastian Münch"
Hi, 
 
we are in the middle of developing a small application using the jdo api on
ojb. The 
tutorials are running fine, now we wanna setup our own app. By compiling our
application, 
we get the following error: 
 
>> 
[JDO] DEBUG: OjbStoreConnector.begin: connectionReadyForRelease=false 
javax.jdo.JDOUserException: Class given to getExtent does not implement 
javax.jdo.spi.PersistenceCapable 
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown
Source) 
at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown
Source) 
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source) 
at test.TestApp.run(TestApp.java:57) 
at test.TestApp.main(TestApp.java:25) 
Exception in thread "main" javax.jdo.JDOUserException: Cannot close 
PersistenceManager while transaction is still active. 
at com.sun.jdori.common.PersistenceManagerImpl.close(Unknown Source)

at
com.sun.jdori.common.PersistenceManagerImpl.popCurrentWrapper(Unknown 
Source) 
at com.sun.jdori.common.PersistenceManagerWrapper.close(Unknown
Source) 
at test.TestApp.run(TestApp.java:76) 
at test.TestApp.main(TestApp.java:25) 
 
 
Our persistent class is HJSTest. We applied the HSJTest.jdo to our
Userclass. The 
following files are located In our project directory: 
 
>> 
HSJTest.jdo 
OJB.properties 
TestApp.class 
TestApp.sh 
Test_ClassDescriptor.xml 
Test_ConnectionDescriptor.xml 
Test_Repository.xml 
cache.ccf 
commons-logging.properties 
jdo.dtd 
log4j.properties 
repository.dtd 
repository.xml 
repository_database.xml 
repository_ejb.xml 
repository_internal.xml 
repository_jdo.xml 
repository_junit.xml 
repository_user.xml 
simplelog.properties 
spy.properties 
test/ 
 
 
Our source code including compiled files are located in the test/ directory.

 
 
We believe, that there is a problem with the Enhancer, adding the
PersistenceCapable - 
Interface to our Class. Can anybody help us on that sibject? 
 
Thx, 
Jing, Holger, Sebastian 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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



[ojb|jdo] Join query using jdo/ojb

2003-11-19 Thread Vijay
Hello all,
 
I was going through some documents related to JDOQL and I found that
they have made the db-objects with other db-objects as attributes for
maintaining foreign key relationship. Example:
 
Employee object represents the Employee table in the database. It has a
attribute department. Now the department itself is an db-object which
represents the Department table. So they are able to use the api of JDO
to make joins using setFilter. 
 
I checked some reversedb tools and they all make dbobjects with the id,
instead of the object itself. 
Example:
Employee object has an attribute named departmentid, instead of
department itself. I understand that the mapping is done in
repository_user.xml about the foreign key relationship. However, in the
above scenario, it is not possible to make join query using setFilter as
in JDO api. 
 
Please let me know if the second approach, of using the Id instead of
object itself is correct. If it is correct, how to make join? Will I
have to use the OJB API? Please help me in this regard. 
 
Thanks in advance.
 
Regards,
 
Vijay Sargunam
 
Icicle Consultancy,
 Web: www.icicleconsultancy.com
 


Re: OJB JDO & multiple database

2003-10-30 Thread Thomas Mahler
Hi Christophe,

Christophe.Demarey wrote:
Hi,

Is there a way how I can simultaneously use multiple databases from OJB 
JDO ?

OJB allows us to specify multiple jdbc-connection in the database 
repository but I don't know how to choose a jdbc-connection via the OJB 
JDO api ?
Currently our JDO solution does only work against the default 
Persistencebroker. So there is currently no way to use more than one db 
with simple API calls.

I wonder if the following JDO code works with OJB :

PersistenceManagerFactory pmf =
(PersistenceManagerFactory) 
Class.forName(pmf_class).newInstance();
pmf.setConnectionURL(db_url);
pmf.setConnectionDriverName(db_driver);
if (user_name != null)
pmf.setConnectionUserName(user_name);
if (password != null)
pmf.setConnectionPassword(password);

Can someone tell me if these properties are used ?
No these methods are are not used in our solution.

If not, what is used and how configure it?
We are using the settings of the default PersistenceBroker in the 
repository.xml.
So you can change the db url by changing the OJB Metadata at runtime 
through the o.a.ojb.broker.metadata.MetaDataManager.

cheers,
Thomas
Thanks.





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


OJB JDO & multiple database

2003-10-29 Thread Christophe.Demarey
Hi,

Is there a way how I can simultaneously use multiple databases from OJB 
JDO ?

OJB allows us to specify multiple jdbc-connection in the database 
repository but I don't know how to choose a jdbc-connection via the OJB 
JDO api ?

I wonder if the following JDO code works with OJB :

PersistenceManagerFactory pmf =
(PersistenceManagerFactory) 
Class.forName(pmf_class).newInstance();
pmf.setConnectionURL(db_url);
pmf.setConnectionDriverName(db_driver);
if (user_name != null)
pmf.setConnectionUserName(user_name);
if (password != null)
pmf.setConnectionPassword(password);

Can someone tell me if these properties are used ?
If not, what is used and how configure it?
Thanks.



--
Christophe Demarey,
Research engineer
OpenCCM project - http://www.objectweb.org/openccm
GOAL Team - CNRS/USTL/LIFL - http://www.lifl.fr/GOAL/
Universite des Sciences et Technologies de Lille
LIFL - UMR CNRS 8022- Batiment M3
59655 Villeneuve d'Ascq Cedex - FRANCE
Phone: +33 (0)32043 4728
Fax  : +33 (0)32043 6566
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problems with OJB & JDO

2003-03-23 Thread Thomas Mahler
You must enhance the byte-code of the tutorial app.
I assume you just forget the ant target enhance-jdori.
(See first section of tutorial4.html).
cheers,
Thomas
Gary Eberhart wrote:
Hello All,

I'm getting the following exception when running the OBJ JDO example
UCListAllProducts.
Any ideas?

javax.jdo.JDOUserException: Class given to getExtent does not implement
javax.jdo.spi.PersistenceCapable
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown Source)
at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown Source)
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
at
org.apache.ojb.tutorial5.UCListAllProducts.apply(UCListAllProducts.java:45)
at org.apache.ojb.tutorial5.Application.run(Application.java:102)
at org.apache.ojb.tutorial5.Application.main(Application.java:70)


Thanks in advance,
Gary


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



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


Problems with OJB & JDO

2003-03-21 Thread Gary Eberhart
Hello All,

I'm getting the following exception when running the OBJ JDO example
UCListAllProducts.

Any ideas?

javax.jdo.JDOUserException: Class given to getExtent does not implement
javax.jdo.spi.PersistenceCapable
at com.sun.jdori.common.PersistenceManagerImpl.getExtent(Unknown Source)
at com.sun.jdori.common.query.QueryImpl.checkCandidates(Unknown Source)
at com.sun.jdori.common.query.QueryImpl.execute(Unknown Source)
at
org.apache.ojb.tutorial5.UCListAllProducts.apply(UCListAllProducts.java:45)
at org.apache.ojb.tutorial5.Application.run(Application.java:102)
at org.apache.ojb.tutorial5.Application.main(Application.java:70)




Thanks in advance,
Gary




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



Re: OJB - JDO - deletePersistent

2003-03-01 Thread Thomas Mahler
Hi again,

Sebastian Thomschke wrote:
Thomas,

I assume this means that Version 1 should work too. 
Yes! The only problem is, We do not have a testsuite for the JDO stuff 
yet...

Is there any chance 
that you can try to fix this problem before OJB Release 2?
I've put it on my personal todo list. I hope to get it fixed before 1.0 
(end of march)

cheers,
Thomas

Thanks,
Sebastian
Mahler Thomas wrote:

Seems to be a buf in my code...

 

-Original Message-
From: Sebastian Thomschke [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 9:44 PM
To: [EMAIL PROTECTED]
Subject: OJB - JDO - deletePersistent
The JDO tutorial uses the pm.getObjectById() method to get an 
instance of a
product to delete it. Shouldn't it be possible to do the same via
pm.newQuery?
In my JDO test project I first tried it using the pm.newQuery() 
method to
get a user object/record. Retrieving was fine, but when I try to 
delete it, OJB throws the following exception:
javax.jdo.JDOUserException: Instance of class
sebthom.jdotest.persistenceObjects.User is not
persistent.
at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistentIn
ternal(PersistenceManagerImpl.java:1823)
at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistent(P
ersistenceManagerImpl.java:739)
at
com.sun.jdori.common.PersistenceManagerWrapper.deletePersisten
t(PersistenceManagerWrapper.java:444)
at sebthom.jdotest.Main.run(Main.java:120)
at sebthom.jdotest.Main.main(Main.java:165)
Exception in thread "main"
When I use the pm.getObjectById() method it works fine. What's wrong 
with
the way using pm.newQuery()?

Thanks in advance.

Regards,
Sebastian
==

// Version 1 using pm.newQuery()
tx = pm.currentTransaction();
tx.begin();
query = pm.newQuery(User.class, "id==" + 10);
result = (Collection) query.execute();
user = (User) result.iterator().next();
if (user == null)
{
 System.out.println("did not find a matching instance...");
 tx.rollback();
}
else
{
 pm.deletePersistent(user);
 tx.commit();
 query.close(result);
}
//Version 2 using pm.getObjectById()
User example = new User();
example.setId(10);
Identity oid = new Identity(example);
User toBeDeleted = (User) pm.getObjectById(oid, false);
tx = pm.currentTransaction();
tx.begin();
pm.deletePersistent(toBeDeleted);
if (toBeDeleted == null)
{
  System.out.println("did not find a matching instance...");
  tx.rollback();
}
else
{
  pm.deletePersistent(toBeDeleted);
  tx.commit();
}
  
 



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





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


Re: OJB - JDO - deletePersistent

2003-02-28 Thread Sebastian Thomschke
Thomas,

I assume this means that Version 1 should work too. Is there any chance 
that you can try to fix this problem before OJB Release 2?

Thanks,
Sebastian
Mahler Thomas wrote:

Seems to be a buf in my code...

 

-Original Message-
From: Sebastian Thomschke [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 9:44 PM
To: [EMAIL PROTECTED]
Subject: OJB - JDO - deletePersistent
The JDO tutorial uses the pm.getObjectById() method to get an 
instance of a
product to delete it. Shouldn't it be possible to do the same via
pm.newQuery?
In my JDO test project I first tried it using the 
pm.newQuery() method to
get a user object/record. Retrieving was fine, but when I try 
to delete it, 
OJB throws the following exception:
javax.jdo.JDOUserException: Instance of class
sebthom.jdotest.persistenceObjects.User is not
persistent.
	at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistentIn
ternal(PersistenceManagerImpl.java:1823)
	at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistent(P
ersistenceManagerImpl.java:739)
	at
com.sun.jdori.common.PersistenceManagerWrapper.deletePersisten
t(PersistenceManagerWrapper.java:444)
	at sebthom.jdotest.Main.run(Main.java:120)
	at sebthom.jdotest.Main.main(Main.java:165)
Exception in thread "main" 

When I use the pm.getObjectById() method it works fine. 
What's wrong with
the way using pm.newQuery()?

Thanks in advance.

Regards,
Sebastian
==

// Version 1 using pm.newQuery()
tx = pm.currentTransaction();
tx.begin();
query = pm.newQuery(User.class, "id==" + 10);
result = (Collection) query.execute();
user = (User) result.iterator().next();
if (user == null)
{
 System.out.println("did not find a matching instance...");
 tx.rollback();
}
else
{
 pm.deletePersistent(user);
 tx.commit();
 query.close(result);
}
//Version 2 using pm.getObjectById()
User example = new User();
example.setId(10);
Identity oid = new Identity(example);
User toBeDeleted = (User) pm.getObjectById(oid, false);
tx = pm.currentTransaction();
tx.begin();
pm.deletePersistent(toBeDeleted);
if (toBeDeleted == null)
{
  System.out.println("did not find a matching instance...");
  tx.rollback();
}
else
{
  pm.deletePersistent(toBeDeleted);
  tx.commit();
}
   

 



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


RE: OJB - JDO - deletePersistent

2003-02-28 Thread Mahler Thomas
Seems to be a buf in my code...

> -Original Message-
> From: Sebastian Thomschke [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 9:44 PM
> To: [EMAIL PROTECTED]
> Subject: OJB - JDO - deletePersistent
> 
> 
> The JDO tutorial uses the pm.getObjectById() method to get an 
> instance of a
> product to delete it. Shouldn't it be possible to do the same via
> pm.newQuery?
> In my JDO test project I first tried it using the 
> pm.newQuery() method to
> get a user object/record. Retrieving was fine, but when I try 
> to delete it, 
> OJB throws the following exception:
> javax.jdo.JDOUserException: Instance of class
> sebthom.jdotest.persistenceObjects.User is not
> persistent.
>   at
> com.sun.jdori.common.PersistenceManagerImpl.deletePersistentIn
> ternal(PersistenceManagerImpl.java:1823)
>   at
> com.sun.jdori.common.PersistenceManagerImpl.deletePersistent(P
> ersistenceManagerImpl.java:739)
>   at
> com.sun.jdori.common.PersistenceManagerWrapper.deletePersisten
> t(PersistenceManagerWrapper.java:444)
>   at sebthom.jdotest.Main.run(Main.java:120)
>   at sebthom.jdotest.Main.main(Main.java:165)
> Exception in thread "main" 
> 
> When I use the pm.getObjectById() method it works fine. 
> What's wrong with
> the way using pm.newQuery()?
> 
> Thanks in advance.
> 
> Regards,
> Sebastian
> 
> ==
> 
> // Version 1 using pm.newQuery()
> tx = pm.currentTransaction();
> tx.begin();
> query = pm.newQuery(User.class, "id==" + 10);
> result = (Collection) query.execute();
> user = (User) result.iterator().next();
> if (user == null)
> {
>   System.out.println("did not find a matching instance...");
>   tx.rollback();
> }
> else
> {
>   pm.deletePersistent(user);
>   tx.commit();
>   query.close(result);
> }
> 
> //Version 2 using pm.getObjectById()
> User example = new User();
> example.setId(10);
> Identity oid = new Identity(example);
> User toBeDeleted = (User) pm.getObjectById(oid, false);
> 
> tx = pm.currentTransaction();
> tx.begin();
> pm.deletePersistent(toBeDeleted);
> if (toBeDeleted == null)
> {
>System.out.println("did not find a matching instance...");
>tx.rollback();
> }
> else
> {
>pm.deletePersistent(toBeDeleted);
>tx.commit();
> }
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!
> 
> 
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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



OJB - JDO - deletePersistent

2003-02-27 Thread Sebastian Thomschke
The JDO tutorial uses the pm.getObjectById() method to get an instance of a
product to delete it. Shouldn't it be possible to do the same via
pm.newQuery?
In my JDO test project I first tried it using the pm.newQuery() method to
get a user object/record. Retrieving was fine, but when I try to delete it, 
OJB throws the following exception:
javax.jdo.JDOUserException: Instance of class
sebthom.jdotest.persistenceObjects.User is not
persistent.
at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistentInternal(PersistenceManagerImpl.java:1823)
at
com.sun.jdori.common.PersistenceManagerImpl.deletePersistent(PersistenceManagerImpl.java:739)
at
com.sun.jdori.common.PersistenceManagerWrapper.deletePersistent(PersistenceManagerWrapper.java:444)
at sebthom.jdotest.Main.run(Main.java:120)
at sebthom.jdotest.Main.main(Main.java:165)
Exception in thread "main" 

When I use the pm.getObjectById() method it works fine. What's wrong with
the way using pm.newQuery()?

Thanks in advance.

Regards,
Sebastian

==

// Version 1 using pm.newQuery()
tx = pm.currentTransaction();
tx.begin();
query = pm.newQuery(User.class, "id==" + 10);
result = (Collection) query.execute();
user = (User) result.iterator().next();
if (user == null)
{
  System.out.println("did not find a matching instance...");
  tx.rollback();
}
else
{
  pm.deletePersistent(user);
  tx.commit();
  query.close(result);
}

//Version 2 using pm.getObjectById()
User example = new User();
example.setId(10);
Identity oid = new Identity(example);
User toBeDeleted = (User) pm.getObjectById(oid, false);

tx = pm.currentTransaction();
tx.begin();
pm.deletePersistent(toBeDeleted);
if (toBeDeleted == null)
{
   System.out.println("did not find a matching instance...");
   tx.rollback();
}
else
{
   pm.deletePersistent(toBeDeleted);
   tx.commit();
}

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!



-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


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