You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Glauber Andrade <gl...@maximasti.com.br> on 2003/09/15 21:20:16 UTC

PROGRESS ?

Hi,

Does the OJB work with Progress Database (Progress 9.1B) ?
Thanks,

Glauber




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


Re: PROGRESS ?

Posted by Jean-Francois Taillon <je...@videotron.ca>.
I also have a customer working with Progress 9.1D...and interested in 
knowing the JDBC driver you use.

Regards,

Jeff

Mark Berry wrote:

>No use the JDBC driver that ships with Progress.
>
>Mark
>
>----- Original Message ----- 
>From: "Glauber Andrade" <gl...@maximasti.com.br>
>To: "OJB Users List" <oj...@db.apache.org>
>Sent: Tuesday, September 16, 2003 1:27 PM
>Subject: Re: PROGRESS ?
>
>
>  
>
>>Hi Mark,
>>
>>Are you using the HSQL driver too, or a Progress driver ?
>>Thanks,
>>
>>Glauber
>>
>>
>>----- Original Message -----
>>From: "Mark Berry" <ma...@labpro2000.com>
>>To: "OJB Users List" <oj...@db.apache.org>
>>Sent: Monday, September 15, 2003 6:50 PM
>>Subject: Re: PROGRESS ?
>>
>>
>>    
>>
>>>Hi Glauber
>>>
>>>    We are using Progress 9.1D06 and OJB.
>>>    We have set it up to use the HSQL database.
>>>
>>>    The only problem we have come across is in writing records with null
>>>      
>>>
>>or
>>    
>>
>>>zero length fields in the primary key.
>>>    Apart from that it appears to perform really well.
>>>
>>>Regards
>>>
>>>Mark Berry
>>>
>>>----- Original Message -----
>>>From: "Glauber Andrade" <gl...@maximasti.com.br>
>>>To: "OJB Users List" <oj...@db.apache.org>
>>>Sent: Tuesday, September 16, 2003 7:20 AM
>>>Subject: PROGRESS ?
>>>
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>Does the OJB work with Progress Database (Progress 9.1B) ?
>>>>Thanks,
>>>>
>>>>Glauber
>>>>        
>>>>
>>
>>---------------------------------------------------------------------
>>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
>
>
>  
>

Re: RC3 x RC4 ?

Posted by Thomas Mahler <th...@web.de>.
Hi Glauber,

It's always recommended to use the latest (hopefully greatest) version.
There has been one complaint about performance degradation, but it has 
not been verified so far.

Thomas

Glauber Andrade wrote:
> Hi,
> 
> Thanks.
> I only want to know if the new version is better, because i read some emails
> talking about the RC4 being slower than RC3... Should I change it ?
> 
> Thanks,
> 
> Glauber
> 
> ----- Original Message -----
> From: "Justis Peters" <ju...@oculan.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, October 02, 2003 11:26 AM
> Subject: Re: RC3 x RC4 ?
> 
> 
> 
>>Hi Glauber,
>>
>>Please read the "release-notes.txt" file that is included with each
> 
> distribution.  It includes details about what is new in each release, up to
> including the release that you downloaded.
> 
>>Thanks,
>>Justis Peters
>>
>>Glauber Andrade [glauber@maximasti.com.br] wrote:
>>
>>>Hi list,
>>>
>>>We are using the RC3 version in our system, it would be better if we
> 
> change
> 
>>>it to RC4 ?
>>>What are the advantages in the RC4 version?
>>>
>>>Thanks,
>>>
>>>Glauber
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
> 
> 


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


Re: too slow!

Posted by Oleg Nitz <on...@ukr.net>.
-----Original Message-----
From: "Glauber Andrade" <gl...@maximasti.com.br>
To: <oj...@db.apache.org>
Date: Mon, 1 Dec 2003 09:45:13 -0300
Subject: too slow!
> I am using OJB and Mysql (4.0.16) (with mysql-connector-java-3.0.9-stable)
> in an swing application and the system is too slow. A simple query whith
> 2000 registers takes more than 15s to go.
> How can I speed it up ?
First of all, does plain JDBC query load the same data much faster?
If yes, you could use proxies to avoid immediate loading of related objects.
If no and queries of this kind will run often, you can build database index for the "id_empresa" column, maybe also for "pagamento".

Regards,
 Oleg

> Criteria crit = new Criteria();
> crit.addEqualTo("id_empresa", "" + empresa.getId());
> crit.addOrderBy("pagamento", true);
> crit.addOrderBy("prestador.nome", true);
> Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
> Collection c = broker.getCollectionByQuery(q);



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


too slow!

Posted by Glauber Andrade <gl...@maximasti.com.br>.
I am using OJB and Mysql (4.0.16) (with mysql-connector-java-3.0.9-stable)
in an swing application and the system is too slow. A simple query whith
2000 registers takes more than 15s to go.
How can I speed it up ?

Thanks,

Criteria crit = new Criteria();
crit.addEqualTo("id_empresa", "" + empresa.getId());
crit.addOrderBy("pagamento", true);
crit.addOrderBy("prestador.nome", true);
Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
Collection c = broker.getCollectionByQuery(q);


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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
i forgot this : i m using ojb rc4

remi

----- Original Message ----- 
From: "Rémi Bars" <rb...@softeam.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 9:44 AM
Subject: Re: Identity


> hi,
>
> i have done the change and all my records are in the database. But now i
get
> this error :
>
> what does it mean?
>
> thanks !
>
> remi
>
> org.apache.ojb.broker.util.sequence.SequenceManagerException:
> java.lang.UnsupportedOperationException: This feature is not supported by
> this implementation
>
>  at
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> Unknown Source)
>
>  at
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> nown Source)
>
>  at
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> Impl.java:1985)
>
>  at
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> .java:1891)
>
>  at
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> .java:1849)
>
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>
>  at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
>
>  at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> Source)
>
>  at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
>
>  at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown Source)
>
>  at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
>
>  at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
>
>
> ----- Original Message ----- 
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Wednesday, November 26, 2003 6:24 PM
> Subject: Re: Identity
>
>
> > doh! Seems I'm tired or dumb ;-)
> > I mean autoincrement="true"
> > Or did you implement your owm sequence manager?
> >
> > abashed,
> > Armin
> >
> > Armin Waibel wrote:
> >
> > > Hi,
> > >
> > > assume you are using SequenceManagerNativeImpl?
> > > Please set primarykey="true"
> > > Which OJB version?
> > >
> > > regards
> > > Armin
> > >
> > > Rémi Bars wrote:
> > >
> > >> Hi all,
> > >>
> > >> i m trying to use identity on sybase with the odmg api. I don t
> > >> understand
> > >> why only one object is insert in my table, when i try to add a second
> > >> object
> > >> i get no error but no record too.
> > >>
> > >> have u an idea?
> > >>
> > >> thanks for ur help!
> > >>
> > >> here is my repository
> > >>
> > >> <class-descriptor class='Structure' table='Structure' >
> > >>            <field-descriptor
> > >>                         name="id"
> > >>                         column="id"
> > >>                         jdbc-type="numeric"
> > >>                         primarykey="true"
> > >>                         autoincrement="false"
> > >>    access="readonly"
> > >>                      />
> > >>            <field-descriptor name='_Nom' column='nom'
> > >> jdbc-type='VARCHAR'/>
> > >> </class-descriptor>
> > >>
> > >> here is my table
> > >> CREATE TABLE Structure (
> > >>
> > >> id numeric(4,0) identity not null,
> > >>
> > >> nom VARCHAR(50) NULL )
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
> >
> >
>
>
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
ok i see nothing about this method in PlatformSybaseASEImpl.java......


----- Original Message ----- 
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 9:59 AM
Subject: Re: Identity


> which DB do you use?
> the platform implementation class have to
> override
>
> public String getLastInsertIdentityQuery(String tableName)
> {
>     // return the sql string to query last inserted Identity value
> }
>
> regards,
> Armin
>
> Rémi Bars wrote:
>
> > hi,
> >
> > i have done the change and all my records are in the database. But now i
get
> > this error :
> >
> > what does it mean?
> >
> > thanks !
> >
> > remi
> >
> > org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > java.lang.UnsupportedOperationException: This feature is not supported
by
> > this implementation
> >
> >  at
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > Unknown Source)
> >
> >  at
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > nown Source)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > Impl.java:1985)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > .java:1891)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > .java:1849)
> >
> >  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >
> >  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >
> >  at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> >
> >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > Source)
> >
> >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> >
> >
> > ----- Original Message ----- 
> > From: "Armin Waibel" <ar...@code-au-lait.de>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Wednesday, November 26, 2003 6:24 PM
> > Subject: Re: Identity
> >
> >
> >
> >>doh! Seems I'm tired or dumb ;-)
> >>I mean autoincrement="true"
> >>Or did you implement your owm sequence manager?
> >>
> >>abashed,
> >>Armin
> >>
> >>Armin Waibel wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>assume you are using SequenceManagerNativeImpl?
> >>>Please set primarykey="true"
> >>>Which OJB version?
> >>>
> >>>regards
> >>>Armin
> >>>
> >>>Rémi Bars wrote:
> >>>
> >>>
> >>>>Hi all,
> >>>>
> >>>>i m trying to use identity on sybase with the odmg api. I don t
> >>>>understand
> >>>>why only one object is insert in my table, when i try to add a second
> >>>>object
> >>>>i get no error but no record too.
> >>>>
> >>>>have u an idea?
> >>>>
> >>>>thanks for ur help!
> >>>>
> >>>>here is my repository
> >>>>
> >>>><class-descriptor class='Structure' table='Structure' >
> >>>>           <field-descriptor
> >>>>                        name="id"
> >>>>                        column="id"
> >>>>                        jdbc-type="numeric"
> >>>>                        primarykey="true"
> >>>>                        autoincrement="false"
> >>>>   access="readonly"
> >>>>                     />
> >>>>           <field-descriptor name='_Nom' column='nom'
> >>>>jdbc-type='VARCHAR'/>
> >>>></class-descriptor>
> >>>>
> >>>>here is my table
> >>>>CREATE TABLE Structure (
> >>>>
> >>>>id numeric(4,0) identity not null,
> >>>>
> >>>>nom VARCHAR(50) NULL )
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>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
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
i ll test it soon in a distributed application, and post my result here:)

Remi

----- Original Message ----- 
From: "Armin Waibel" <ar...@apache.org>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, February 10, 2004 11:57 AM
Subject: Re: Identity


> ok, I will add your patch.
> We may run into the same problems in an clustered environment with a
> distributed lock management (same temp values on different cluster
> nodes), but this will be another story... ;-)
>
> regards,
> Armin
>
> Rémi Bars wrote:
>
> >>Think the problem is the lock of the objects before insert.
> >>SequenceManagerNativeImpl returns a temp key and OJB builds an Identity
> >>object to do the lock. In an multithreaded environment it is possible
> >>that two threads lookup the same temp key.
> >
> >
> > yes it s th problem i have put a System.out.println  when the appli try
to
> > get the getUniqueLong -> i saw multiple reference on the same tempkey
> >
> >
> >>If your solution works for you I will update SequenceManagerNativeImpl.
> >>To verify my assumption (and your solution), can you post the whole
> >>stack trace (+ error log before the exception if available) if you use
> >>the "unmodified version" of SequenceManagerNativeImpl?
> >
> >
> > 0     DEBUG [main] sequence.SequenceManagerNativeImpl - After store -
> > newid=42
> >
> > org.odmg.LockNotGrantedException: Can not lock
> > fr.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736 for
WRITE
> >
> >  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source)
> >
> >  at
> >
fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_PersistentManager.insert(OJ
> > B_ODMG_PersistentManager.java:143)
> >
> >  at
> >
fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_CezanGestionnaireDAO.create
> > (OJB_ODMG_CezanGestionnaireDAO.java:64)
> >
> >  at
> >
fr.sip.cezan.serveur.ordre.work.GestionnaireOrdreImpl.creerFichierOrdre(Gest
> > ionnaireOrdreImpl.java:532)
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Identity

Posted by Armin Waibel <ar...@apache.org>.
ok, I will add your patch.
We may run into the same problems in an clustered environment with a 
distributed lock management (same temp values on different cluster 
nodes), but this will be another story... ;-)

regards,
Armin

Rémi Bars wrote:

>>Think the problem is the lock of the objects before insert.
>>SequenceManagerNativeImpl returns a temp key and OJB builds an Identity
>>object to do the lock. In an multithreaded environment it is possible
>>that two threads lookup the same temp key.
> 
> 
> yes it s th problem i have put a System.out.println  when the appli try to
> get the getUniqueLong -> i saw multiple reference on the same tempkey
> 
> 
>>If your solution works for you I will update SequenceManagerNativeImpl.
>>To verify my assumption (and your solution), can you post the whole
>>stack trace (+ error log before the exception if available) if you use
>>the "unmodified version" of SequenceManagerNativeImpl?
> 
> 
> 0     DEBUG [main] sequence.SequenceManagerNativeImpl - After store -
> newid=42
> 
> org.odmg.LockNotGrantedException: Can not lock
> fr.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736 for WRITE
> 
>  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source)
> 
>  at
> fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_PersistentManager.insert(OJ
> B_ODMG_PersistentManager.java:143)
> 
>  at
> fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_CezanGestionnaireDAO.create
> (OJB_ODMG_CezanGestionnaireDAO.java:64)
> 
>  at
> fr.sip.cezan.serveur.ordre.work.GestionnaireOrdreImpl.creerFichierOrdre(Gest
> ionnaireOrdreImpl.java:532)
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
> Think the problem is the lock of the objects before insert.
> SequenceManagerNativeImpl returns a temp key and OJB builds an Identity
> object to do the lock. In an multithreaded environment it is possible
> that two threads lookup the same temp key.

yes it s th problem i have put a System.out.println  when the appli try to
get the getUniqueLong -> i saw multiple reference on the same tempkey

> If your solution works for you I will update SequenceManagerNativeImpl.
> To verify my assumption (and your solution), can you post the whole
> stack trace (+ error log before the exception if available) if you use
> the "unmodified version" of SequenceManagerNativeImpl?

0     DEBUG [main] sequence.SequenceManagerNativeImpl - After store -
newid=42

org.odmg.LockNotGrantedException: Can not lock
fr.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736 for WRITE

 at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source)

 at
fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_PersistentManager.insert(OJ
B_ODMG_PersistentManager.java:143)

 at
fr.sip.cezan.framework.persistance.odmg.OJB_ODMG_CezanGestionnaireDAO.create
(OJB_ODMG_CezanGestionnaireDAO.java:64)

 at
fr.sip.cezan.serveur.ordre.work.GestionnaireOrdreImpl.creerFichierOrdre(Gest
ionnaireOrdreImpl.java:532)


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


Re: Identity

Posted by Armin Waibel <ar...@apache.org>.
Rémi Bars wrote:

> 
>  Hi
> 
> 
>>>it works when i put the private --> static <---long tempKey ,  is it
> 
> right
> 
>>>to do that in the  SequenceManagerNativeImpl?
>>>
> 
> 
>>hmm, seems the temp key has to be unique arcoss different threads.
> 
> 
>>If
>>you don't do that what's the problem, do you end with an
>>LockNotGrantedException?
> 
> 
> yes my insert in the database don t work

Think the problem is the lock of the objects before insert. 
SequenceManagerNativeImpl returns a temp key and OJB builds an Identity 
object to do the lock. In an multithreaded environment it is possible 
that two threads lookup the same temp key.

If your solution works for you I will update SequenceManagerNativeImpl.
To verify my assumption (and your solution), can you post the whole 
stack trace (+ error log before the exception if available) if you use 
the "unmodified version" of SequenceManagerNativeImpl?

regards,
Arminh

> 
> remi
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.

 Hi

> > it works when i put the private --> static <---long tempKey ,  is it
right
> > to do that in the  SequenceManagerNativeImpl?
> >

> hmm, seems the temp key has to be unique arcoss different threads.

>If
> you don't do that what's the problem, do you end with an
> LockNotGrantedException?

yes my insert in the database don t work

remi


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


Re: Identity

Posted by Armin Waibel <ar...@apache.org>.
Hi Remin,

Rémi Bars wrote:

> it works when i put the private --> static <---long tempKey ,  is it right
> to do that in the  SequenceManagerNativeImpl?
> 

hmm, seems the temp key has to be unique arcoss different threads. If 
you don't do that what's the problem, do you end with an 
LockNotGrantedException?

regards,
Armin

> thanks
> 
> Remi
> 
> ----- Original Message ----- 
> From: "Rémi Bars" <rb...@softeam.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Tuesday, February 10, 2004 10:43 AM
> Subject: Re: Identity
> 
> 
> 
>>sorry it works fine now i have found a old code in my ojb....
>>
>>Remi
>>----- Original Message ----- 
>>From: "Rémi Bars" <rb...@softeam.fr>
>>To: "OJB Users List" <oj...@db.apache.org>
>>Sent: Tuesday, February 10, 2004 10:41 AM
>>Subject: Re: Identity
>>
>>
>>
>>>Hello
>>>
>>>i have a bug on rc5, i got the same in rc4 (see beelow) but whith some
>>>changes it has worked. I have try to put the same code in rc5 and i get
>>
>>the
>>
>>>following error. I m a on sybase with rc5 and i use identity columns
>>>
>>>rg.odmg.LockNotGrantedException: Can not lock
>>>
>>
> fr.ouestfrance.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736
> 
>>>for WRITE
>>> at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
>>>
>>>thanks
>>>
>>>remi
>>>
>>>
>>>----- Original Message ----- 
>>>From: "Rémi Bars" <rb...@softeam.fr>
>>>To: "OJB Users List" <oj...@db.apache.org>
>>>Sent: Thursday, November 27, 2003 5:45 PM
>>>Subject: Re: Identity
>>>
>>>
>>>
>>>>ok thanks it works fine now
>>>>
>>>>Remi
>>>>
>>>>----- Original Message ----- 
>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>Sent: Thursday, November 27, 2003 5:31 PM
>>>>Subject: Re: Identity
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I think this is a bug in SequenceManagerNativeImpl.
>>>>>This should be fixed with current CVS.
>>>>>A workaround for rc4 could be a replacement of
>>>>>
>>>>>protected long getUniqueLong(FieldDescriptor field) throws
>>>>>SequenceManagerException
>>>>>{
>>>>>   return -1;
>>>>>}
>>>>>
>>>>>with
>>>>>
>>>>>private long tempKey = -1;
>>>>>
>>>>>protected long getUniqueLong(FieldDescriptor field) throws
>>>>>SequenceManagerException
>>>>>{
>>>>>     /*
>>>>>     workaround for locking problems of new objects
>>>>>     We need unique 'dummy keys' for new objects before storing
>>>>>     */
>>>>>     return --tempKey;
>>>>>}
>>>>>
>>>>>We need a different temporary key for each requested
>>>>>key. This key will be replaced by the Identity value
>>>>>after the object was written to DB.
>>>>>
>>>>>HTH
>>>>>regards,
>>>>>Armin
>>>>>
>>>>>Rémi Bars wrote:
>>>>>
>>>>>
>>>>>>hi,
>>>>>>
>>>>>>i have try to put this in my code
>>>>>>
>>>>>>public String getLastInsertIdentityQuery(String tableName)
>>>>>>    {
>>>>>>        return "select @@identity"; (i need wait for an upgrade on
>>>>
>>>>sybase
>>>>
>>>>>>and test select last_insert_id() )
>>>>>>    }
>>>>>>
>>>>>>
>>>>>>
>>>>>>it works fine for the first record when i try to insert a second
>>>
>>>record
>>>
>>>>i
>>>>
>>>>>>get :
>>>>>>
>>>>>>org.odmg.LockNotGrantedException: Can not lock
>>>>>>TypeCompositionStructure@cccfb954 for WRITE
>>>>>>
>>>>>> at
>>
>>org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
>>
>>>>>>what does it means? (sometimes it works.....when i m a on
> 
> debugger)
> 
>>>>>>remi
>>>>>>
>>>>>>----- Original Message ----- 
>>>>>>From: "Rémi Bars" <rb...@softeam.fr>
>>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>>Sent: Thursday, November 27, 2003 10:02 AM
>>>>>>Subject: Re: Identity
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>i m using sybase
>>>>>>>
>>>>>>>where can i find the platformù implementation?
>>>>>>>
>>>>>>>----- Original Message ----- 
>>>>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>>>Sent: Thursday, November 27, 2003 9:59 AM
>>>>>>>Subject: Re: Identity
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>which DB do you use?
>>>>>>>>the platform implementation class have to
>>>>>>>>override
>>>>>>>>
>>>>>>>>public String getLastInsertIdentityQuery(String tableName)
>>>>>>>>{
>>>>>>>>   // return the sql string to query last inserted Identity
> 
> value
> 
>>>>>>>>}
>>>>>>>>
>>>>>>>>regards,
>>>>>>>>Armin
>>>>>>>>
>>>>>>>>Rémi Bars wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>hi,
>>>>>>>>>
>>>>>>>>>i have done the change and all my records are in the database.
> 
> But
> 
>>>now
>>>
>>>>>>i
>>>>>>
>>>>>>
>>>>>>>get
>>>>>>>
>>>>>>>
>>>>>>>>>this error :
>>>>>>>>>
>>>>>>>>>what does it mean?
>>>>>>>>>
>>>>>>>>>thanks !
>>>>>>>>>
>>>>>>>>>remi
>>>>>>>>>
>>>>>>>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
>>>>>>>>>java.lang.UnsupportedOperationException: This feature is not
>>>
>>>supported
>>>
>>>>>>>by
>>>>>>>
>>>>>>>
>>>>>>>>>this implementation
>>>>>>>>>
>>>>>>>>>at
>>>>>>>>>
>>>>>>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> 
>>>>>>>>>Unknown Source)
>>>>>>>>>
>>>>>>>>>at
>>>>>>>>>
>>>>>>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> 
>>>>>>>>>nown Source)
>>>>>>>>>
>>>>>>>>>at
>>>>>>>>>
>>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> 
>>>>>>>>>Impl.java:1985)
>>>>>>>>>
>>>>>>>>>at
>>>>>>>>>
>>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>>>>>>.java:1891)
>>>>>>>>>
>>>>>>>>>at
>>>>>>>>>
>>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>>>>>>.java:1849)
>>>>>>>>>
>>>>>>>>>at
>>>>>>
>>>>>>
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> 
>>>>>>>>>Source)
>>>>>>>>>
>>>>>>>>>at
>>>>>>
>>>>>>
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> 
>>>>>>>>>Source)
>>>>>>>>>
>>>>>>>>>at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown
>>
>>Source)
>>
>>>>>>>>>at
>>>
>>>org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
>>>
>>>>>>>>>Source)
>>>>>>>>>
>>>>>>>>>at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown
> 
> Source)
> 
>>>>>>>>>at
> 
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> 
>>>>>>>Source)
>>>>>>>
>>>>>>>
>>>>>>>>>at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
>>>>>>>>>
>>>>>>>>>at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>----- Original Message ----- 
>>>>>>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>>>>>Sent: Wednesday, November 26, 2003 6:24 PM
>>>>>>>>>Subject: Re: Identity
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>doh! Seems I'm tired or dumb ;-)
>>>>>>>>>>I mean autoincrement="true"
>>>>>>>>>>Or did you implement your owm sequence manager?
>>>>>>>>>>
>>>>>>>>>>abashed,
>>>>>>>>>>Armin
>>>>>>>>>>
>>>>>>>>>>Armin Waibel wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>Hi,
>>>>>>>>>>>
>>>>>>>>>>>assume you are using SequenceManagerNativeImpl?
>>>>>>>>>>>Please set primarykey="true"
>>>>>>>>>>>Which OJB version?
>>>>>>>>>>>
>>>>>>>>>>>regards
>>>>>>>>>>>Armin
>>>>>>>>>>>
>>>>>>>>>>>Rémi Bars wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>Hi all,
>>>>>>>>>>>>
>>>>>>>>>>>>i m trying to use identity on sybase with the odmg api. I don
> 
> t
> 
>>>>>>>>>>>>understand
>>>>>>>>>>>>why only one object is insert in my table, when i try to add
> 
> a
> 
>>>>>>second
>>>>>>
>>>>>>
>>>>>>>>>>>>object
>>>>>>>>>>>>i get no error but no record too.
>>>>>>>>>>>>
>>>>>>>>>>>>have u an idea?
>>>>>>>>>>>>
>>>>>>>>>>>>thanks for ur help!
>>>>>>>>>>>>
>>>>>>>>>>>>here is my repository
>>>>>>>>>>>>
>>>>>>>>>>>><class-descriptor class='Structure' table='Structure' >
>>>>>>>>>>>>         <field-descriptor
>>>>>>>>>>>>                      name="id"
>>>>>>>>>>>>                      column="id"
>>>>>>>>>>>>                      jdbc-type="numeric"
>>>>>>>>>>>>                      primarykey="true"
>>>>>>>>>>>>                      autoincrement="false"
>>>>>>>>>>>> access="readonly"
>>>>>>>>>>>>                   />
>>>>>>>>>>>>         <field-descriptor name='_Nom' column='nom'
>>>>>>>>>>>>jdbc-type='VARCHAR'/>
>>>>>>>>>>>></class-descriptor>
>>>>>>>>>>>>
>>>>>>>>>>>>here is my table
>>>>>>>>>>>>CREATE TABLE Structure (
>>>>>>>>>>>>
>>>>>>>>>>>>id numeric(4,0) identity not null,
>>>>>>>>>>>>
>>>>>>>>>>>>nom VARCHAR(50) NULL )
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>
>>>>>>>>>>>>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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>
>>>>>>>>>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
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>---------------------------------------------------------------------
>>>
>>>>>>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
>>>>
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
> 
> 
> 

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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
it works when i put the private --> static <---long tempKey ,  is it right
to do that in the  SequenceManagerNativeImpl?

thanks

Remi

----- Original Message ----- 
From: "Rémi Bars" <rb...@softeam.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, February 10, 2004 10:43 AM
Subject: Re: Identity


> sorry it works fine now i have found a old code in my ojb....
>
> Remi
> ----- Original Message ----- 
> From: "Rémi Bars" <rb...@softeam.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Tuesday, February 10, 2004 10:41 AM
> Subject: Re: Identity
>
>
> > Hello
> >
> > i have a bug on rc5, i got the same in rc4 (see beelow) but whith some
> > changes it has worked. I have try to put the same code in rc5 and i get
> the
> > following error. I m a on sybase with rc5 and i use identity columns
> >
> > rg.odmg.LockNotGrantedException: Can not lock
> >
>
fr.ouestfrance.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736
> > for WRITE
> >  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
> >
> > thanks
> >
> > remi
> >
> >
> > ----- Original Message ----- 
> > From: "Rémi Bars" <rb...@softeam.fr>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, November 27, 2003 5:45 PM
> > Subject: Re: Identity
> >
> >
> > > ok thanks it works fine now
> > >
> > > Remi
> > >
> > > ----- Original Message ----- 
> > > From: "Armin Waibel" <ar...@code-au-lait.de>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Thursday, November 27, 2003 5:31 PM
> > > Subject: Re: Identity
> > >
> > >
> > > > Hi,
> > > >
> > > > I think this is a bug in SequenceManagerNativeImpl.
> > > > This should be fixed with current CVS.
> > > > A workaround for rc4 could be a replacement of
> > > >
> > > > protected long getUniqueLong(FieldDescriptor field) throws
> > > > SequenceManagerException
> > > > {
> > > >    return -1;
> > > > }
> > > >
> > > > with
> > > >
> > > > private long tempKey = -1;
> > > >
> > > > protected long getUniqueLong(FieldDescriptor field) throws
> > > > SequenceManagerException
> > > > {
> > > >      /*
> > > >      workaround for locking problems of new objects
> > > >      We need unique 'dummy keys' for new objects before storing
> > > >      */
> > > >      return --tempKey;
> > > > }
> > > >
> > > > We need a different temporary key for each requested
> > > > key. This key will be replaced by the Identity value
> > > > after the object was written to DB.
> > > >
> > > > HTH
> > > > regards,
> > > > Armin
> > > >
> > > > Rémi Bars wrote:
> > > >
> > > > > hi,
> > > > >
> > > > > i have try to put this in my code
> > > > >
> > > > > public String getLastInsertIdentityQuery(String tableName)
> > > > >     {
> > > > >         return "select @@identity"; (i need wait for an upgrade on
> > > sybase
> > > > > and test select last_insert_id() )
> > > > >     }
> > > > >
> > > > >
> > > > >
> > > > > it works fine for the first record when i try to insert a second
> > record
> > > i
> > > > > get :
> > > > >
> > > > > org.odmg.LockNotGrantedException: Can not lock
> > > > > TypeCompositionStructure@cccfb954 for WRITE
> > > > >
> > > > >  at
> org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> > > > >
> > > > > what does it means? (sometimes it works.....when i m a on
debugger)
> > > > >
> > > > > remi
> > > > >
> > > > > ----- Original Message ----- 
> > > > > From: "Rémi Bars" <rb...@softeam.fr>
> > > > > To: "OJB Users List" <oj...@db.apache.org>
> > > > > Sent: Thursday, November 27, 2003 10:02 AM
> > > > > Subject: Re: Identity
> > > > >
> > > > >
> > > > >
> > > > >>i m using sybase
> > > > >>
> > > > >>where can i find the platformù implementation?
> > > > >>
> > > > >>----- Original Message ----- 
> > > > >>From: "Armin Waibel" <ar...@code-au-lait.de>
> > > > >>To: "OJB Users List" <oj...@db.apache.org>
> > > > >>Sent: Thursday, November 27, 2003 9:59 AM
> > > > >>Subject: Re: Identity
> > > > >>
> > > > >>
> > > > >>
> > > > >>>which DB do you use?
> > > > >>>the platform implementation class have to
> > > > >>>override
> > > > >>>
> > > > >>>public String getLastInsertIdentityQuery(String tableName)
> > > > >>>{
> > > > >>>    // return the sql string to query last inserted Identity
value
> > > > >>>}
> > > > >>>
> > > > >>>regards,
> > > > >>>Armin
> > > > >>>
> > > > >>>Rémi Bars wrote:
> > > > >>>
> > > > >>>
> > > > >>>>hi,
> > > > >>>>
> > > > >>>>i have done the change and all my records are in the database.
But
> > now
> > > > >
> > > > > i
> > > > >
> > > > >>get
> > > > >>
> > > > >>>>this error :
> > > > >>>>
> > > > >>>>what does it mean?
> > > > >>>>
> > > > >>>>thanks !
> > > > >>>>
> > > > >>>>remi
> > > > >>>>
> > > > >>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > > > >>>>java.lang.UnsupportedOperationException: This feature is not
> > supported
> > > > >>
> > > > >>by
> > > > >>
> > > > >>>>this implementation
> > > > >>>>
> > > > >>>> at
> > > > >>>>
> > > > >>
> > > > >
> > >
> >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > > > >
> > > > >>>>Unknown Source)
> > > > >>>>
> > > > >>>> at
> > > > >>>>
> > > > >>
> > > > >
> > >
> >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > > > >
> > > > >>>>nown Source)
> > > > >>>>
> > > > >>>> at
> > > > >>>>
> > > > >>
> > > > >
> > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > > > >
> > > > >>>>Impl.java:1985)
> > > > >>>>
> > > > >>>> at
> > > > >>>>
> > > > >>
> > > > >
> > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > > >
> > > > >>>>.java:1891)
> > > > >>>>
> > > > >>>> at
> > > > >>>>
> > > > >>
> > > > >
> > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > > >
> > > > >>>>.java:1849)
> > > > >>>>
> > > > >>>> at
> > > > >
> > > > >
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > > >
> > > > >>>>Source)
> > > > >>>>
> > > > >>>> at
> > > > >
> > > > >
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > > >
> > > > >>>>Source)
> > > > >>>>
> > > > >>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown
> Source)
> > > > >>>>
> > > > >>>> at
> > org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > > > >>>>Source)
> > > > >>>>
> > > > >>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown
Source)
> > > > >>>>
> > > > >>>> at
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> > > > >>
> > > > >>Source)
> > > > >>
> > > > >>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> > > > >>>>
> > > > >>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> > > > >>>>
> > > > >>>>
> > > > >>>>----- Original Message ----- 
> > > > >>>>From: "Armin Waibel" <ar...@code-au-lait.de>
> > > > >>>>To: "OJB Users List" <oj...@db.apache.org>
> > > > >>>>Sent: Wednesday, November 26, 2003 6:24 PM
> > > > >>>>Subject: Re: Identity
> > > > >>>>
> > > > >>>>
> > > > >>>>
> > > > >>>>
> > > > >>>>>doh! Seems I'm tired or dumb ;-)
> > > > >>>>>I mean autoincrement="true"
> > > > >>>>>Or did you implement your owm sequence manager?
> > > > >>>>>
> > > > >>>>>abashed,
> > > > >>>>>Armin
> > > > >>>>>
> > > > >>>>>Armin Waibel wrote:
> > > > >>>>>
> > > > >>>>>
> > > > >>>>>
> > > > >>>>>>Hi,
> > > > >>>>>>
> > > > >>>>>>assume you are using SequenceManagerNativeImpl?
> > > > >>>>>>Please set primarykey="true"
> > > > >>>>>>Which OJB version?
> > > > >>>>>>
> > > > >>>>>>regards
> > > > >>>>>>Armin
> > > > >>>>>>
> > > > >>>>>>Rémi Bars wrote:
> > > > >>>>>>
> > > > >>>>>>
> > > > >>>>>>
> > > > >>>>>>>Hi all,
> > > > >>>>>>>
> > > > >>>>>>>i m trying to use identity on sybase with the odmg api. I don
t
> > > > >>>>>>>understand
> > > > >>>>>>>why only one object is insert in my table, when i try to add
a
> > > > >
> > > > > second
> > > > >
> > > > >>>>>>>object
> > > > >>>>>>>i get no error but no record too.
> > > > >>>>>>>
> > > > >>>>>>>have u an idea?
> > > > >>>>>>>
> > > > >>>>>>>thanks for ur help!
> > > > >>>>>>>
> > > > >>>>>>>here is my repository
> > > > >>>>>>>
> > > > >>>>>>><class-descriptor class='Structure' table='Structure' >
> > > > >>>>>>>          <field-descriptor
> > > > >>>>>>>                       name="id"
> > > > >>>>>>>                       column="id"
> > > > >>>>>>>                       jdbc-type="numeric"
> > > > >>>>>>>                       primarykey="true"
> > > > >>>>>>>                       autoincrement="false"
> > > > >>>>>>>  access="readonly"
> > > > >>>>>>>                    />
> > > > >>>>>>>          <field-descriptor name='_Nom' column='nom'
> > > > >>>>>>>jdbc-type='VARCHAR'/>
> > > > >>>>>>></class-descriptor>
> > > > >>>>>>>
> > > > >>>>>>>here is my table
> > > > >>>>>>>CREATE TABLE Structure (
> > > > >>>>>>>
> > > > >>>>>>>id numeric(4,0) identity not null,
> > > > >>>>>>>
> > > > >>>>>>>nom VARCHAR(50) NULL )
> > > > >>>>>>>
> > > > >>>>>>>
> > > > >>>
> > > >
> >
>>>>>---------------------------------------------------------------------
> > > > >>>>>
> > > > >>>>>>>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
> > > > >>>>>
> > > > >>>>>
> > > > >>>>
> > > > >>>>
> > > > >>>>
> > > >
> >
>>>>---------------------------------------------------------------------
> > > > >>>>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
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > 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
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Identity

Posted by Armin Waibel <ar...@apache.org>.
puh! glad to hear that!

regards,
Armin

Rémi Bars wrote:

> sorry it works fine now i have found a old code in my ojb....
> 
> Remi
> ----- Original Message ----- 
> From: "Rémi Bars" <rb...@softeam.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Tuesday, February 10, 2004 10:41 AM
> Subject: Re: Identity
> 
> 
> 
>>Hello
>>
>>i have a bug on rc5, i got the same in rc4 (see beelow) but whith some
>>changes it has worked. I have try to put the same code in rc5 and i get
> 
> the
> 
>>following error. I m a on sybase with rc5 and i use identity columns
>>
>>rg.odmg.LockNotGrantedException: Can not lock
>>
> 
> fr.ouestfrance.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736
> 
>>for WRITE
>> at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
>>
>>thanks
>>
>>remi
>>
>>
>>----- Original Message ----- 
>>From: "Rémi Bars" <rb...@softeam.fr>
>>To: "OJB Users List" <oj...@db.apache.org>
>>Sent: Thursday, November 27, 2003 5:45 PM
>>Subject: Re: Identity
>>
>>
>>
>>>ok thanks it works fine now
>>>
>>>Remi
>>>
>>>----- Original Message ----- 
>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>To: "OJB Users List" <oj...@db.apache.org>
>>>Sent: Thursday, November 27, 2003 5:31 PM
>>>Subject: Re: Identity
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>I think this is a bug in SequenceManagerNativeImpl.
>>>>This should be fixed with current CVS.
>>>>A workaround for rc4 could be a replacement of
>>>>
>>>>protected long getUniqueLong(FieldDescriptor field) throws
>>>>SequenceManagerException
>>>>{
>>>>   return -1;
>>>>}
>>>>
>>>>with
>>>>
>>>>private long tempKey = -1;
>>>>
>>>>protected long getUniqueLong(FieldDescriptor field) throws
>>>>SequenceManagerException
>>>>{
>>>>     /*
>>>>     workaround for locking problems of new objects
>>>>     We need unique 'dummy keys' for new objects before storing
>>>>     */
>>>>     return --tempKey;
>>>>}
>>>>
>>>>We need a different temporary key for each requested
>>>>key. This key will be replaced by the Identity value
>>>>after the object was written to DB.
>>>>
>>>>HTH
>>>>regards,
>>>>Armin
>>>>
>>>>Rémi Bars wrote:
>>>>
>>>>
>>>>>hi,
>>>>>
>>>>>i have try to put this in my code
>>>>>
>>>>>public String getLastInsertIdentityQuery(String tableName)
>>>>>    {
>>>>>        return "select @@identity"; (i need wait for an upgrade on
>>>
>>>sybase
>>>
>>>>>and test select last_insert_id() )
>>>>>    }
>>>>>
>>>>>
>>>>>
>>>>>it works fine for the first record when i try to insert a second
>>
>>record
>>
>>>i
>>>
>>>>>get :
>>>>>
>>>>>org.odmg.LockNotGrantedException: Can not lock
>>>>>TypeCompositionStructure@cccfb954 for WRITE
>>>>>
>>>>> at
> 
> org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> 
>>>>>what does it means? (sometimes it works.....when i m a on debugger)
>>>>>
>>>>>remi
>>>>>
>>>>>----- Original Message ----- 
>>>>>From: "Rémi Bars" <rb...@softeam.fr>
>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>Sent: Thursday, November 27, 2003 10:02 AM
>>>>>Subject: Re: Identity
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>i m using sybase
>>>>>>
>>>>>>where can i find the platformù implementation?
>>>>>>
>>>>>>----- Original Message ----- 
>>>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>>Sent: Thursday, November 27, 2003 9:59 AM
>>>>>>Subject: Re: Identity
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>which DB do you use?
>>>>>>>the platform implementation class have to
>>>>>>>override
>>>>>>>
>>>>>>>public String getLastInsertIdentityQuery(String tableName)
>>>>>>>{
>>>>>>>   // return the sql string to query last inserted Identity value
>>>>>>>}
>>>>>>>
>>>>>>>regards,
>>>>>>>Armin
>>>>>>>
>>>>>>>Rémi Bars wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>hi,
>>>>>>>>
>>>>>>>>i have done the change and all my records are in the database. But
>>
>>now
>>
>>>>>i
>>>>>
>>>>>
>>>>>>get
>>>>>>
>>>>>>
>>>>>>>>this error :
>>>>>>>>
>>>>>>>>what does it mean?
>>>>>>>>
>>>>>>>>thanks !
>>>>>>>>
>>>>>>>>remi
>>>>>>>>
>>>>>>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
>>>>>>>>java.lang.UnsupportedOperationException: This feature is not
>>
>>supported
>>
>>>>>>by
>>>>>>
>>>>>>
>>>>>>>>this implementation
>>>>>>>>
>>>>>>>>at
>>>>>>>>
>>>>>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> 
>>>>>>>>Unknown Source)
>>>>>>>>
>>>>>>>>at
>>>>>>>>
>>>>>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> 
>>>>>>>>nown Source)
>>>>>>>>
>>>>>>>>at
>>>>>>>>
>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> 
>>>>>>>>Impl.java:1985)
>>>>>>>>
>>>>>>>>at
>>>>>>>>
>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>>>>>.java:1891)
>>>>>>>>
>>>>>>>>at
>>>>>>>>
>>>>>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>>>>>.java:1849)
>>>>>>>>
>>>>>>>>at
>>>>>
>>>>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>>
>>>>>
>>>>>>>>Source)
>>>>>>>>
>>>>>>>>at
>>>>>
>>>>>org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>>
>>>>>
>>>>>>>>Source)
>>>>>>>>
>>>>>>>>at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown
> 
> Source)
> 
>>>>>>>>at
>>
>>org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
>>
>>>>>>>>Source)
>>>>>>>>
>>>>>>>>at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
>>>>>>>>
>>>>>>>>at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
>>>>>>
>>>>>>Source)
>>>>>>
>>>>>>
>>>>>>>>at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
>>>>>>>>
>>>>>>>>at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
>>>>>>>>
>>>>>>>>
>>>>>>>>----- Original Message ----- 
>>>>>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>>>>>Sent: Wednesday, November 26, 2003 6:24 PM
>>>>>>>>Subject: Re: Identity
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>doh! Seems I'm tired or dumb ;-)
>>>>>>>>>I mean autoincrement="true"
>>>>>>>>>Or did you implement your owm sequence manager?
>>>>>>>>>
>>>>>>>>>abashed,
>>>>>>>>>Armin
>>>>>>>>>
>>>>>>>>>Armin Waibel wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Hi,
>>>>>>>>>>
>>>>>>>>>>assume you are using SequenceManagerNativeImpl?
>>>>>>>>>>Please set primarykey="true"
>>>>>>>>>>Which OJB version?
>>>>>>>>>>
>>>>>>>>>>regards
>>>>>>>>>>Armin
>>>>>>>>>>
>>>>>>>>>>Rémi Bars wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>Hi all,
>>>>>>>>>>>
>>>>>>>>>>>i m trying to use identity on sybase with the odmg api. I don t
>>>>>>>>>>>understand
>>>>>>>>>>>why only one object is insert in my table, when i try to add a
>>>>>
>>>>>second
>>>>>
>>>>>
>>>>>>>>>>>object
>>>>>>>>>>>i get no error but no record too.
>>>>>>>>>>>
>>>>>>>>>>>have u an idea?
>>>>>>>>>>>
>>>>>>>>>>>thanks for ur help!
>>>>>>>>>>>
>>>>>>>>>>>here is my repository
>>>>>>>>>>>
>>>>>>>>>>><class-descriptor class='Structure' table='Structure' >
>>>>>>>>>>>         <field-descriptor
>>>>>>>>>>>                      name="id"
>>>>>>>>>>>                      column="id"
>>>>>>>>>>>                      jdbc-type="numeric"
>>>>>>>>>>>                      primarykey="true"
>>>>>>>>>>>                      autoincrement="false"
>>>>>>>>>>> access="readonly"
>>>>>>>>>>>                   />
>>>>>>>>>>>         <field-descriptor name='_Nom' column='nom'
>>>>>>>>>>>jdbc-type='VARCHAR'/>
>>>>>>>>>>></class-descriptor>
>>>>>>>>>>>
>>>>>>>>>>>here is my table
>>>>>>>>>>>CREATE TABLE Structure (
>>>>>>>>>>>
>>>>>>>>>>>id numeric(4,0) identity not null,
>>>>>>>>>>>
>>>>>>>>>>>nom VARCHAR(50) NULL )
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>
>>>>>>>---------------------------------------------------------------------
>>>>>>>
>>>>>>>>>>>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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>
>>>>>>>>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
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>---------------------------------------------------------------------
>>
>>>>>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
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
sorry it works fine now i have found a old code in my ojb....

Remi
----- Original Message ----- 
From: "Rémi Bars" <rb...@softeam.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, February 10, 2004 10:41 AM
Subject: Re: Identity


> Hello
>
> i have a bug on rc5, i got the same in rc4 (see beelow) but whith some
> changes it has worked. I have try to put the same code in rc5 and i get
the
> following error. I m a on sybase with rc5 and i use identity columns
>
> rg.odmg.LockNotGrantedException: Can not lock
>
fr.ouestfrance.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736
> for WRITE
>  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
>
> thanks
>
> remi
>
>
> ----- Original Message ----- 
> From: "Rémi Bars" <rb...@softeam.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, November 27, 2003 5:45 PM
> Subject: Re: Identity
>
>
> > ok thanks it works fine now
> >
> > Remi
> >
> > ----- Original Message ----- 
> > From: "Armin Waibel" <ar...@code-au-lait.de>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, November 27, 2003 5:31 PM
> > Subject: Re: Identity
> >
> >
> > > Hi,
> > >
> > > I think this is a bug in SequenceManagerNativeImpl.
> > > This should be fixed with current CVS.
> > > A workaround for rc4 could be a replacement of
> > >
> > > protected long getUniqueLong(FieldDescriptor field) throws
> > > SequenceManagerException
> > > {
> > >    return -1;
> > > }
> > >
> > > with
> > >
> > > private long tempKey = -1;
> > >
> > > protected long getUniqueLong(FieldDescriptor field) throws
> > > SequenceManagerException
> > > {
> > >      /*
> > >      workaround for locking problems of new objects
> > >      We need unique 'dummy keys' for new objects before storing
> > >      */
> > >      return --tempKey;
> > > }
> > >
> > > We need a different temporary key for each requested
> > > key. This key will be replaced by the Identity value
> > > after the object was written to DB.
> > >
> > > HTH
> > > regards,
> > > Armin
> > >
> > > Rémi Bars wrote:
> > >
> > > > hi,
> > > >
> > > > i have try to put this in my code
> > > >
> > > > public String getLastInsertIdentityQuery(String tableName)
> > > >     {
> > > >         return "select @@identity"; (i need wait for an upgrade on
> > sybase
> > > > and test select last_insert_id() )
> > > >     }
> > > >
> > > >
> > > >
> > > > it works fine for the first record when i try to insert a second
> record
> > i
> > > > get :
> > > >
> > > > org.odmg.LockNotGrantedException: Can not lock
> > > > TypeCompositionStructure@cccfb954 for WRITE
> > > >
> > > >  at
org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> > > >
> > > > what does it means? (sometimes it works.....when i m a on debugger)
> > > >
> > > > remi
> > > >
> > > > ----- Original Message ----- 
> > > > From: "Rémi Bars" <rb...@softeam.fr>
> > > > To: "OJB Users List" <oj...@db.apache.org>
> > > > Sent: Thursday, November 27, 2003 10:02 AM
> > > > Subject: Re: Identity
> > > >
> > > >
> > > >
> > > >>i m using sybase
> > > >>
> > > >>where can i find the platformù implementation?
> > > >>
> > > >>----- Original Message ----- 
> > > >>From: "Armin Waibel" <ar...@code-au-lait.de>
> > > >>To: "OJB Users List" <oj...@db.apache.org>
> > > >>Sent: Thursday, November 27, 2003 9:59 AM
> > > >>Subject: Re: Identity
> > > >>
> > > >>
> > > >>
> > > >>>which DB do you use?
> > > >>>the platform implementation class have to
> > > >>>override
> > > >>>
> > > >>>public String getLastInsertIdentityQuery(String tableName)
> > > >>>{
> > > >>>    // return the sql string to query last inserted Identity value
> > > >>>}
> > > >>>
> > > >>>regards,
> > > >>>Armin
> > > >>>
> > > >>>Rémi Bars wrote:
> > > >>>
> > > >>>
> > > >>>>hi,
> > > >>>>
> > > >>>>i have done the change and all my records are in the database. But
> now
> > > >
> > > > i
> > > >
> > > >>get
> > > >>
> > > >>>>this error :
> > > >>>>
> > > >>>>what does it mean?
> > > >>>>
> > > >>>>thanks !
> > > >>>>
> > > >>>>remi
> > > >>>>
> > > >>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > > >>>>java.lang.UnsupportedOperationException: This feature is not
> supported
> > > >>
> > > >>by
> > > >>
> > > >>>>this implementation
> > > >>>>
> > > >>>> at
> > > >>>>
> > > >>
> > > >
> >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > > >
> > > >>>>Unknown Source)
> > > >>>>
> > > >>>> at
> > > >>>>
> > > >>
> > > >
> >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > > >
> > > >>>>nown Source)
> > > >>>>
> > > >>>> at
> > > >>>>
> > > >>
> > > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > > >
> > > >>>>Impl.java:1985)
> > > >>>>
> > > >>>> at
> > > >>>>
> > > >>
> > > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > >
> > > >>>>.java:1891)
> > > >>>>
> > > >>>> at
> > > >>>>
> > > >>
> > > >
> >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > >
> > > >>>>.java:1849)
> > > >>>>
> > > >>>> at
> > > >
> > > > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > >
> > > >>>>Source)
> > > >>>>
> > > >>>> at
> > > >
> > > > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > >
> > > >>>>Source)
> > > >>>>
> > > >>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown
Source)
> > > >>>>
> > > >>>> at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > > >>>>Source)
> > > >>>>
> > > >>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> > > >>>>
> > > >>>> at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> > > >>
> > > >>Source)
> > > >>
> > > >>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> > > >>>>
> > > >>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> > > >>>>
> > > >>>>
> > > >>>>----- Original Message ----- 
> > > >>>>From: "Armin Waibel" <ar...@code-au-lait.de>
> > > >>>>To: "OJB Users List" <oj...@db.apache.org>
> > > >>>>Sent: Wednesday, November 26, 2003 6:24 PM
> > > >>>>Subject: Re: Identity
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>>doh! Seems I'm tired or dumb ;-)
> > > >>>>>I mean autoincrement="true"
> > > >>>>>Or did you implement your owm sequence manager?
> > > >>>>>
> > > >>>>>abashed,
> > > >>>>>Armin
> > > >>>>>
> > > >>>>>Armin Waibel wrote:
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>>Hi,
> > > >>>>>>
> > > >>>>>>assume you are using SequenceManagerNativeImpl?
> > > >>>>>>Please set primarykey="true"
> > > >>>>>>Which OJB version?
> > > >>>>>>
> > > >>>>>>regards
> > > >>>>>>Armin
> > > >>>>>>
> > > >>>>>>Rémi Bars wrote:
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>Hi all,
> > > >>>>>>>
> > > >>>>>>>i m trying to use identity on sybase with the odmg api. I don t
> > > >>>>>>>understand
> > > >>>>>>>why only one object is insert in my table, when i try to add a
> > > >
> > > > second
> > > >
> > > >>>>>>>object
> > > >>>>>>>i get no error but no record too.
> > > >>>>>>>
> > > >>>>>>>have u an idea?
> > > >>>>>>>
> > > >>>>>>>thanks for ur help!
> > > >>>>>>>
> > > >>>>>>>here is my repository
> > > >>>>>>>
> > > >>>>>>><class-descriptor class='Structure' table='Structure' >
> > > >>>>>>>          <field-descriptor
> > > >>>>>>>                       name="id"
> > > >>>>>>>                       column="id"
> > > >>>>>>>                       jdbc-type="numeric"
> > > >>>>>>>                       primarykey="true"
> > > >>>>>>>                       autoincrement="false"
> > > >>>>>>>  access="readonly"
> > > >>>>>>>                    />
> > > >>>>>>>          <field-descriptor name='_Nom' column='nom'
> > > >>>>>>>jdbc-type='VARCHAR'/>
> > > >>>>>>></class-descriptor>
> > > >>>>>>>
> > > >>>>>>>here is my table
> > > >>>>>>>CREATE TABLE Structure (
> > > >>>>>>>
> > > >>>>>>>id numeric(4,0) identity not null,
> > > >>>>>>>
> > > >>>>>>>nom VARCHAR(50) NULL )
> > > >>>>>>>
> > > >>>>>>>
> > > >>>
> > >
> >>>>>---------------------------------------------------------------------
> > > >>>>>
> > > >>>>>>>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
> > > >>>>>
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > >
> >>>>---------------------------------------------------------------------
> > > >>>>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
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > 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
> >
> >
>
>
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
Hello

i have a bug on rc5, i got the same in rc4 (see beelow) but whith some
changes it has worked. I have try to put the same code in rc5 and i get the
following error. I m a on sybase with rc5 and i use identity columns

rg.odmg.LockNotGrantedException: Can not lock
fr.ouestfrance.sip.cezan.serveur.ordre.work.FichierRoleOrdreServeur@19f3736
for WRITE
 at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source

thanks

remi


----- Original Message ----- 
From: "Rémi Bars" <rb...@softeam.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 5:45 PM
Subject: Re: Identity


> ok thanks it works fine now
>
> Remi
>
> ----- Original Message ----- 
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, November 27, 2003 5:31 PM
> Subject: Re: Identity
>
>
> > Hi,
> >
> > I think this is a bug in SequenceManagerNativeImpl.
> > This should be fixed with current CVS.
> > A workaround for rc4 could be a replacement of
> >
> > protected long getUniqueLong(FieldDescriptor field) throws
> > SequenceManagerException
> > {
> >    return -1;
> > }
> >
> > with
> >
> > private long tempKey = -1;
> >
> > protected long getUniqueLong(FieldDescriptor field) throws
> > SequenceManagerException
> > {
> >      /*
> >      workaround for locking problems of new objects
> >      We need unique 'dummy keys' for new objects before storing
> >      */
> >      return --tempKey;
> > }
> >
> > We need a different temporary key for each requested
> > key. This key will be replaced by the Identity value
> > after the object was written to DB.
> >
> > HTH
> > regards,
> > Armin
> >
> > Rémi Bars wrote:
> >
> > > hi,
> > >
> > > i have try to put this in my code
> > >
> > > public String getLastInsertIdentityQuery(String tableName)
> > >     {
> > >         return "select @@identity"; (i need wait for an upgrade on
> sybase
> > > and test select last_insert_id() )
> > >     }
> > >
> > >
> > >
> > > it works fine for the first record when i try to insert a second
record
> i
> > > get :
> > >
> > > org.odmg.LockNotGrantedException: Can not lock
> > > TypeCompositionStructure@cccfb954 for WRITE
> > >
> > >  at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> > >
> > > what does it means? (sometimes it works.....when i m a on debugger)
> > >
> > > remi
> > >
> > > ----- Original Message ----- 
> > > From: "Rémi Bars" <rb...@softeam.fr>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Thursday, November 27, 2003 10:02 AM
> > > Subject: Re: Identity
> > >
> > >
> > >
> > >>i m using sybase
> > >>
> > >>where can i find the platformù implementation?
> > >>
> > >>----- Original Message ----- 
> > >>From: "Armin Waibel" <ar...@code-au-lait.de>
> > >>To: "OJB Users List" <oj...@db.apache.org>
> > >>Sent: Thursday, November 27, 2003 9:59 AM
> > >>Subject: Re: Identity
> > >>
> > >>
> > >>
> > >>>which DB do you use?
> > >>>the platform implementation class have to
> > >>>override
> > >>>
> > >>>public String getLastInsertIdentityQuery(String tableName)
> > >>>{
> > >>>    // return the sql string to query last inserted Identity value
> > >>>}
> > >>>
> > >>>regards,
> > >>>Armin
> > >>>
> > >>>Rémi Bars wrote:
> > >>>
> > >>>
> > >>>>hi,
> > >>>>
> > >>>>i have done the change and all my records are in the database. But
now
> > >
> > > i
> > >
> > >>get
> > >>
> > >>>>this error :
> > >>>>
> > >>>>what does it mean?
> > >>>>
> > >>>>thanks !
> > >>>>
> > >>>>remi
> > >>>>
> > >>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > >>>>java.lang.UnsupportedOperationException: This feature is not
supported
> > >>
> > >>by
> > >>
> > >>>>this implementation
> > >>>>
> > >>>> at
> > >>>>
> > >>
> > >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > >
> > >>>>Unknown Source)
> > >>>>
> > >>>> at
> > >>>>
> > >>
> > >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > >
> > >>>>nown Source)
> > >>>>
> > >>>> at
> > >>>>
> > >>
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > >
> > >>>>Impl.java:1985)
> > >>>>
> > >>>> at
> > >>>>
> > >>
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > >
> > >>>>.java:1891)
> > >>>>
> > >>>> at
> > >>>>
> > >>
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > >
> > >>>>.java:1849)
> > >>>>
> > >>>> at
> > >
> > > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > >
> > >>>>Source)
> > >>>>
> > >>>> at
> > >
> > > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > >
> > >>>>Source)
> > >>>>
> > >>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> > >>>>
> > >>>> at
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > >>>>Source)
> > >>>>
> > >>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> > >>>>
> > >>>> at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> > >>
> > >>Source)
> > >>
> > >>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> > >>>>
> > >>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> > >>>>
> > >>>>
> > >>>>----- Original Message ----- 
> > >>>>From: "Armin Waibel" <ar...@code-au-lait.de>
> > >>>>To: "OJB Users List" <oj...@db.apache.org>
> > >>>>Sent: Wednesday, November 26, 2003 6:24 PM
> > >>>>Subject: Re: Identity
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>>doh! Seems I'm tired or dumb ;-)
> > >>>>>I mean autoincrement="true"
> > >>>>>Or did you implement your owm sequence manager?
> > >>>>>
> > >>>>>abashed,
> > >>>>>Armin
> > >>>>>
> > >>>>>Armin Waibel wrote:
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>Hi,
> > >>>>>>
> > >>>>>>assume you are using SequenceManagerNativeImpl?
> > >>>>>>Please set primarykey="true"
> > >>>>>>Which OJB version?
> > >>>>>>
> > >>>>>>regards
> > >>>>>>Armin
> > >>>>>>
> > >>>>>>Rémi Bars wrote:
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>>Hi all,
> > >>>>>>>
> > >>>>>>>i m trying to use identity on sybase with the odmg api. I don t
> > >>>>>>>understand
> > >>>>>>>why only one object is insert in my table, when i try to add a
> > >
> > > second
> > >
> > >>>>>>>object
> > >>>>>>>i get no error but no record too.
> > >>>>>>>
> > >>>>>>>have u an idea?
> > >>>>>>>
> > >>>>>>>thanks for ur help!
> > >>>>>>>
> > >>>>>>>here is my repository
> > >>>>>>>
> > >>>>>>><class-descriptor class='Structure' table='Structure' >
> > >>>>>>>          <field-descriptor
> > >>>>>>>                       name="id"
> > >>>>>>>                       column="id"
> > >>>>>>>                       jdbc-type="numeric"
> > >>>>>>>                       primarykey="true"
> > >>>>>>>                       autoincrement="false"
> > >>>>>>>  access="readonly"
> > >>>>>>>                    />
> > >>>>>>>          <field-descriptor name='_Nom' column='nom'
> > >>>>>>>jdbc-type='VARCHAR'/>
> > >>>>>>></class-descriptor>
> > >>>>>>>
> > >>>>>>>here is my table
> > >>>>>>>CREATE TABLE Structure (
> > >>>>>>>
> > >>>>>>>id numeric(4,0) identity not null,
> > >>>>>>>
> > >>>>>>>nom VARCHAR(50) NULL )
> > >>>>>>>
> > >>>>>>>
> > >>>
> >
>>>>>---------------------------------------------------------------------
> > >>>>>
> > >>>>>>>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
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>>
> >
>>>>---------------------------------------------------------------------
> > >>>>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
> > >>
> > >>
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>


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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
ok thanks it works fine now

Remi

----- Original Message ----- 
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 5:31 PM
Subject: Re: Identity


> Hi,
>
> I think this is a bug in SequenceManagerNativeImpl.
> This should be fixed with current CVS.
> A workaround for rc4 could be a replacement of
>
> protected long getUniqueLong(FieldDescriptor field) throws
> SequenceManagerException
> {
>    return -1;
> }
>
> with
>
> private long tempKey = -1;
>
> protected long getUniqueLong(FieldDescriptor field) throws
> SequenceManagerException
> {
>      /*
>      workaround for locking problems of new objects
>      We need unique 'dummy keys' for new objects before storing
>      */
>      return --tempKey;
> }
>
> We need a different temporary key for each requested
> key. This key will be replaced by the Identity value
> after the object was written to DB.
>
> HTH
> regards,
> Armin
>
> Rémi Bars wrote:
>
> > hi,
> >
> > i have try to put this in my code
> >
> > public String getLastInsertIdentityQuery(String tableName)
> >     {
> >         return "select @@identity"; (i need wait for an upgrade on
sybase
> > and test select last_insert_id() )
> >     }
> >
> >
> >
> > it works fine for the first record when i try to insert a second record
i
> > get :
> >
> > org.odmg.LockNotGrantedException: Can not lock
> > TypeCompositionStructure@cccfb954 for WRITE
> >
> >  at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> >
> > what does it means? (sometimes it works.....when i m a on debugger)
> >
> > remi
> >
> > ----- Original Message ----- 
> > From: "Rémi Bars" <rb...@softeam.fr>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, November 27, 2003 10:02 AM
> > Subject: Re: Identity
> >
> >
> >
> >>i m using sybase
> >>
> >>where can i find the platformù implementation?
> >>
> >>----- Original Message ----- 
> >>From: "Armin Waibel" <ar...@code-au-lait.de>
> >>To: "OJB Users List" <oj...@db.apache.org>
> >>Sent: Thursday, November 27, 2003 9:59 AM
> >>Subject: Re: Identity
> >>
> >>
> >>
> >>>which DB do you use?
> >>>the platform implementation class have to
> >>>override
> >>>
> >>>public String getLastInsertIdentityQuery(String tableName)
> >>>{
> >>>    // return the sql string to query last inserted Identity value
> >>>}
> >>>
> >>>regards,
> >>>Armin
> >>>
> >>>Rémi Bars wrote:
> >>>
> >>>
> >>>>hi,
> >>>>
> >>>>i have done the change and all my records are in the database. But now
> >
> > i
> >
> >>get
> >>
> >>>>this error :
> >>>>
> >>>>what does it mean?
> >>>>
> >>>>thanks !
> >>>>
> >>>>remi
> >>>>
> >>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
> >>>>java.lang.UnsupportedOperationException: This feature is not supported
> >>
> >>by
> >>
> >>>>this implementation
> >>>>
> >>>> at
> >>>>
> >>
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> >
> >>>>Unknown Source)
> >>>>
> >>>> at
> >>>>
> >>
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> >
> >>>>nown Source)
> >>>>
> >>>> at
> >>>>
> >>
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> >
> >>>>Impl.java:1985)
> >>>>
> >>>> at
> >>>>
> >>
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> >
> >>>>.java:1891)
> >>>>
> >>>> at
> >>>>
> >>
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> >
> >>>>.java:1849)
> >>>>
> >>>> at
> >
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> >
> >>>>Source)
> >>>>
> >>>> at
> >
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> >
> >>>>Source)
> >>>>
> >>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> >>>>
> >>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> >>>>Source)
> >>>>
> >>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> >>>>
> >>>> at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> >>
> >>Source)
> >>
> >>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> >>>>
> >>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> >>>>
> >>>>
> >>>>----- Original Message ----- 
> >>>>From: "Armin Waibel" <ar...@code-au-lait.de>
> >>>>To: "OJB Users List" <oj...@db.apache.org>
> >>>>Sent: Wednesday, November 26, 2003 6:24 PM
> >>>>Subject: Re: Identity
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>doh! Seems I'm tired or dumb ;-)
> >>>>>I mean autoincrement="true"
> >>>>>Or did you implement your owm sequence manager?
> >>>>>
> >>>>>abashed,
> >>>>>Armin
> >>>>>
> >>>>>Armin Waibel wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Hi,
> >>>>>>
> >>>>>>assume you are using SequenceManagerNativeImpl?
> >>>>>>Please set primarykey="true"
> >>>>>>Which OJB version?
> >>>>>>
> >>>>>>regards
> >>>>>>Armin
> >>>>>>
> >>>>>>Rémi Bars wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>Hi all,
> >>>>>>>
> >>>>>>>i m trying to use identity on sybase with the odmg api. I don t
> >>>>>>>understand
> >>>>>>>why only one object is insert in my table, when i try to add a
> >
> > second
> >
> >>>>>>>object
> >>>>>>>i get no error but no record too.
> >>>>>>>
> >>>>>>>have u an idea?
> >>>>>>>
> >>>>>>>thanks for ur help!
> >>>>>>>
> >>>>>>>here is my repository
> >>>>>>>
> >>>>>>><class-descriptor class='Structure' table='Structure' >
> >>>>>>>          <field-descriptor
> >>>>>>>                       name="id"
> >>>>>>>                       column="id"
> >>>>>>>                       jdbc-type="numeric"
> >>>>>>>                       primarykey="true"
> >>>>>>>                       autoincrement="false"
> >>>>>>>  access="readonly"
> >>>>>>>                    />
> >>>>>>>          <field-descriptor name='_Nom' column='nom'
> >>>>>>>jdbc-type='VARCHAR'/>
> >>>>>>></class-descriptor>
> >>>>>>>
> >>>>>>>here is my table
> >>>>>>>CREATE TABLE Structure (
> >>>>>>>
> >>>>>>>id numeric(4,0) identity not null,
> >>>>>>>
> >>>>>>>nom VARCHAR(50) NULL )
> >>>>>>>
> >>>>>>>
> >>>
> >>>>>---------------------------------------------------------------------
> >>>>>
> >>>>>>>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
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>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
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Identity

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi,

I think this is a bug in SequenceManagerNativeImpl.
This should be fixed with current CVS.
A workaround for rc4 could be a replacement of

protected long getUniqueLong(FieldDescriptor field) throws 
SequenceManagerException
{
   return -1;
}

with

private long tempKey = -1;

protected long getUniqueLong(FieldDescriptor field) throws 
SequenceManagerException
{
     /*
     workaround for locking problems of new objects
     We need unique 'dummy keys' for new objects before storing
     */
     return --tempKey;
}

We need a different temporary key for each requested
key. This key will be replaced by the Identity value
after the object was written to DB.

HTH
regards,
Armin

Rémi Bars wrote:

> hi,
> 
> i have try to put this in my code
> 
> public String getLastInsertIdentityQuery(String tableName)
>     {
>         return "select @@identity"; (i need wait for an upgrade on sybase
> and test select last_insert_id() )
>     }
> 
> 
> 
> it works fine for the first record when i try to insert a second record i
> get :
> 
> org.odmg.LockNotGrantedException: Can not lock
> TypeCompositionStructure@cccfb954 for WRITE
> 
>  at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)
> 
> what does it means? (sometimes it works.....when i m a on debugger)
> 
> remi
> 
> ----- Original Message ----- 
> From: "Rémi Bars" <rb...@softeam.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, November 27, 2003 10:02 AM
> Subject: Re: Identity
> 
> 
> 
>>i m using sybase
>>
>>where can i find the platformù implementation?
>>
>>----- Original Message ----- 
>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>To: "OJB Users List" <oj...@db.apache.org>
>>Sent: Thursday, November 27, 2003 9:59 AM
>>Subject: Re: Identity
>>
>>
>>
>>>which DB do you use?
>>>the platform implementation class have to
>>>override
>>>
>>>public String getLastInsertIdentityQuery(String tableName)
>>>{
>>>    // return the sql string to query last inserted Identity value
>>>}
>>>
>>>regards,
>>>Armin
>>>
>>>Rémi Bars wrote:
>>>
>>>
>>>>hi,
>>>>
>>>>i have done the change and all my records are in the database. But now
> 
> i
> 
>>get
>>
>>>>this error :
>>>>
>>>>what does it mean?
>>>>
>>>>thanks !
>>>>
>>>>remi
>>>>
>>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
>>>>java.lang.UnsupportedOperationException: This feature is not supported
>>
>>by
>>
>>>>this implementation
>>>>
>>>> at
>>>>
>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> 
>>>>Unknown Source)
>>>>
>>>> at
>>>>
>>
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> 
>>>>nown Source)
>>>>
>>>> at
>>>>
>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> 
>>>>Impl.java:1985)
>>>>
>>>> at
>>>>
>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>.java:1891)
>>>>
>>>> at
>>>>
>>
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>>.java:1849)
>>>>
>>>> at
> 
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> 
>>>>Source)
>>>>
>>>> at
> 
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> 
>>>>Source)
>>>>
>>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
>>>>
>>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
>>>>Source)
>>>>
>>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
>>>>
>>>> at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
>>
>>Source)
>>
>>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
>>>>
>>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
>>>>
>>>>
>>>>----- Original Message ----- 
>>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>>To: "OJB Users List" <oj...@db.apache.org>
>>>>Sent: Wednesday, November 26, 2003 6:24 PM
>>>>Subject: Re: Identity
>>>>
>>>>
>>>>
>>>>
>>>>>doh! Seems I'm tired or dumb ;-)
>>>>>I mean autoincrement="true"
>>>>>Or did you implement your owm sequence manager?
>>>>>
>>>>>abashed,
>>>>>Armin
>>>>>
>>>>>Armin Waibel wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>assume you are using SequenceManagerNativeImpl?
>>>>>>Please set primarykey="true"
>>>>>>Which OJB version?
>>>>>>
>>>>>>regards
>>>>>>Armin
>>>>>>
>>>>>>Rémi Bars wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi all,
>>>>>>>
>>>>>>>i m trying to use identity on sybase with the odmg api. I don t
>>>>>>>understand
>>>>>>>why only one object is insert in my table, when i try to add a
> 
> second
> 
>>>>>>>object
>>>>>>>i get no error but no record too.
>>>>>>>
>>>>>>>have u an idea?
>>>>>>>
>>>>>>>thanks for ur help!
>>>>>>>
>>>>>>>here is my repository
>>>>>>>
>>>>>>><class-descriptor class='Structure' table='Structure' >
>>>>>>>          <field-descriptor
>>>>>>>                       name="id"
>>>>>>>                       column="id"
>>>>>>>                       jdbc-type="numeric"
>>>>>>>                       primarykey="true"
>>>>>>>                       autoincrement="false"
>>>>>>>  access="readonly"
>>>>>>>                    />
>>>>>>>          <field-descriptor name='_Nom' column='nom'
>>>>>>>jdbc-type='VARCHAR'/>
>>>>>>></class-descriptor>
>>>>>>>
>>>>>>>here is my table
>>>>>>>CREATE TABLE Structure (
>>>>>>>
>>>>>>>id numeric(4,0) identity not null,
>>>>>>>
>>>>>>>nom VARCHAR(50) NULL )
>>>>>>>
>>>>>>>
>>>
>>>>>---------------------------------------------------------------------
>>>>>
>>>>>>>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
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
hi,

i have try to put this in my code

public String getLastInsertIdentityQuery(String tableName)
    {
        return "select @@identity"; (i need wait for an upgrade on sybase
and test select last_insert_id() )
    }



it works fine for the first record when i try to insert a second record i
get :

org.odmg.LockNotGrantedException: Can not lock
TypeCompositionStructure@cccfb954 for WRITE

 at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:279)

what does it means? (sometimes it works.....when i m a on debugger)

remi

----- Original Message ----- 
From: "Rémi Bars" <rb...@softeam.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 10:02 AM
Subject: Re: Identity


> i m using sybase
>
> where can i find the platformù implementation?
>
> ----- Original Message ----- 
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, November 27, 2003 9:59 AM
> Subject: Re: Identity
>
>
> > which DB do you use?
> > the platform implementation class have to
> > override
> >
> > public String getLastInsertIdentityQuery(String tableName)
> > {
> >     // return the sql string to query last inserted Identity value
> > }
> >
> > regards,
> > Armin
> >
> > Rémi Bars wrote:
> >
> > > hi,
> > >
> > > i have done the change and all my records are in the database. But now
i
> get
> > > this error :
> > >
> > > what does it mean?
> > >
> > > thanks !
> > >
> > > remi
> > >
> > > org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > > java.lang.UnsupportedOperationException: This feature is not supported
> by
> > > this implementation
> > >
> > >  at
> > >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > > Unknown Source)
> > >
> > >  at
> > >
>
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > > nown Source)
> > >
> > >  at
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > > Impl.java:1985)
> > >
> > >  at
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > .java:1891)
> > >
> > >  at
> > >
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > > .java:1849)
> > >
> > >  at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > Source)
> > >
> > >  at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > > Source)
> > >
> > >  at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> > >
> > >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > > Source)
> > >
> > >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> > >
> > >  at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> Source)
> > >
> > >  at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> > >
> > >  at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> > >
> > >
> > > ----- Original Message ----- 
> > > From: "Armin Waibel" <ar...@code-au-lait.de>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Wednesday, November 26, 2003 6:24 PM
> > > Subject: Re: Identity
> > >
> > >
> > >
> > >>doh! Seems I'm tired or dumb ;-)
> > >>I mean autoincrement="true"
> > >>Or did you implement your owm sequence manager?
> > >>
> > >>abashed,
> > >>Armin
> > >>
> > >>Armin Waibel wrote:
> > >>
> > >>
> > >>>Hi,
> > >>>
> > >>>assume you are using SequenceManagerNativeImpl?
> > >>>Please set primarykey="true"
> > >>>Which OJB version?
> > >>>
> > >>>regards
> > >>>Armin
> > >>>
> > >>>Rémi Bars wrote:
> > >>>
> > >>>
> > >>>>Hi all,
> > >>>>
> > >>>>i m trying to use identity on sybase with the odmg api. I don t
> > >>>>understand
> > >>>>why only one object is insert in my table, when i try to add a
second
> > >>>>object
> > >>>>i get no error but no record too.
> > >>>>
> > >>>>have u an idea?
> > >>>>
> > >>>>thanks for ur help!
> > >>>>
> > >>>>here is my repository
> > >>>>
> > >>>><class-descriptor class='Structure' table='Structure' >
> > >>>>           <field-descriptor
> > >>>>                        name="id"
> > >>>>                        column="id"
> > >>>>                        jdbc-type="numeric"
> > >>>>                        primarykey="true"
> > >>>>                        autoincrement="false"
> > >>>>   access="readonly"
> > >>>>                     />
> > >>>>           <field-descriptor name='_Nom' column='nom'
> > >>>>jdbc-type='VARCHAR'/>
> > >>>></class-descriptor>
> > >>>>
> > >>>>here is my table
> > >>>>CREATE TABLE Structure (
> > >>>>
> > >>>>id numeric(4,0) identity not null,
> > >>>>
> > >>>>nom VARCHAR(50) NULL )
> > >>>>
> > >>>>
> >
>>>>---------------------------------------------------------------------
> > >>>>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
> > >>
> > >>
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>


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


Re: Identity

Posted by Armin Waibel <ar...@code-au-lait.de>.
org.apache.ojb.broker.platforms package

Armin

Rémi Bars wrote:

> i m using sybase
> 
> where can i find the platformù implementation?
> 
> ----- Original Message ----- 
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, November 27, 2003 9:59 AM
> Subject: Re: Identity
> 
> 
> 
>>which DB do you use?
>>the platform implementation class have to
>>override
>>
>>public String getLastInsertIdentityQuery(String tableName)
>>{
>>    // return the sql string to query last inserted Identity value
>>}
>>
>>regards,
>>Armin
>>
>>Rémi Bars wrote:
>>
>>
>>>hi,
>>>
>>>i have done the change and all my records are in the database. But now i
> 
> get
> 
>>>this error :
>>>
>>>what does it mean?
>>>
>>>thanks !
>>>
>>>remi
>>>
>>>org.apache.ojb.broker.util.sequence.SequenceManagerException:
>>>java.lang.UnsupportedOperationException: This feature is not supported
> 
> by
> 
>>>this implementation
>>>
>>> at
>>>
> 
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> 
>>>Unknown Source)
>>>
>>> at
>>>
> 
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> 
>>>nown Source)
>>>
>>> at
>>>
> 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> 
>>>Impl.java:1985)
>>>
>>> at
>>>
> 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>.java:1891)
>>>
>>> at
>>>
> 
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> 
>>>.java:1849)
>>>
>>> at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>Source)
>>>
>>> at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>Source)
>>>
>>> at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
>>>
>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
>>>Source)
>>>
>>> at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
>>>
>>> at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
> 
> Source)
> 
>>> at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
>>>
>>> at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
>>>
>>>
>>>----- Original Message ----- 
>>>From: "Armin Waibel" <ar...@code-au-lait.de>
>>>To: "OJB Users List" <oj...@db.apache.org>
>>>Sent: Wednesday, November 26, 2003 6:24 PM
>>>Subject: Re: Identity
>>>
>>>
>>>
>>>
>>>>doh! Seems I'm tired or dumb ;-)
>>>>I mean autoincrement="true"
>>>>Or did you implement your owm sequence manager?
>>>>
>>>>abashed,
>>>>Armin
>>>>
>>>>Armin Waibel wrote:
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>assume you are using SequenceManagerNativeImpl?
>>>>>Please set primarykey="true"
>>>>>Which OJB version?
>>>>>
>>>>>regards
>>>>>Armin
>>>>>
>>>>>Rémi Bars wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Hi all,
>>>>>>
>>>>>>i m trying to use identity on sybase with the odmg api. I don t
>>>>>>understand
>>>>>>why only one object is insert in my table, when i try to add a second
>>>>>>object
>>>>>>i get no error but no record too.
>>>>>>
>>>>>>have u an idea?
>>>>>>
>>>>>>thanks for ur help!
>>>>>>
>>>>>>here is my repository
>>>>>>
>>>>>><class-descriptor class='Structure' table='Structure' >
>>>>>>          <field-descriptor
>>>>>>                       name="id"
>>>>>>                       column="id"
>>>>>>                       jdbc-type="numeric"
>>>>>>                       primarykey="true"
>>>>>>                       autoincrement="false"
>>>>>>  access="readonly"
>>>>>>                    />
>>>>>>          <field-descriptor name='_Nom' column='nom'
>>>>>>jdbc-type='VARCHAR'/>
>>>>>></class-descriptor>
>>>>>>
>>>>>>here is my table
>>>>>>CREATE TABLE Structure (
>>>>>>
>>>>>>id numeric(4,0) identity not null,
>>>>>>
>>>>>>nom VARCHAR(50) NULL )
>>>>>>
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>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
>>>>
>>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
> 
> 
> 



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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
i m using sybase

where can i find the platformù implementation?

----- Original Message ----- 
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, November 27, 2003 9:59 AM
Subject: Re: Identity


> which DB do you use?
> the platform implementation class have to
> override
>
> public String getLastInsertIdentityQuery(String tableName)
> {
>     // return the sql string to query last inserted Identity value
> }
>
> regards,
> Armin
>
> Rémi Bars wrote:
>
> > hi,
> >
> > i have done the change and all my records are in the database. But now i
get
> > this error :
> >
> > what does it mean?
> >
> > thanks !
> >
> > remi
> >
> > org.apache.ojb.broker.util.sequence.SequenceManagerException:
> > java.lang.UnsupportedOperationException: This feature is not supported
by
> > this implementation
> >
> >  at
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> > Unknown Source)
> >
> >  at
> >
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> > nown Source)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> > Impl.java:1985)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > .java:1891)
> >
> >  at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> > .java:1849)
> >
> >  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >
> >  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >
> >  at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> >
> >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> > Source)
> >
> >  at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown
Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> >
> >  at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> >
> >
> > ----- Original Message ----- 
> > From: "Armin Waibel" <ar...@code-au-lait.de>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Wednesday, November 26, 2003 6:24 PM
> > Subject: Re: Identity
> >
> >
> >
> >>doh! Seems I'm tired or dumb ;-)
> >>I mean autoincrement="true"
> >>Or did you implement your owm sequence manager?
> >>
> >>abashed,
> >>Armin
> >>
> >>Armin Waibel wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>assume you are using SequenceManagerNativeImpl?
> >>>Please set primarykey="true"
> >>>Which OJB version?
> >>>
> >>>regards
> >>>Armin
> >>>
> >>>Rémi Bars wrote:
> >>>
> >>>
> >>>>Hi all,
> >>>>
> >>>>i m trying to use identity on sybase with the odmg api. I don t
> >>>>understand
> >>>>why only one object is insert in my table, when i try to add a second
> >>>>object
> >>>>i get no error but no record too.
> >>>>
> >>>>have u an idea?
> >>>>
> >>>>thanks for ur help!
> >>>>
> >>>>here is my repository
> >>>>
> >>>><class-descriptor class='Structure' table='Structure' >
> >>>>           <field-descriptor
> >>>>                        name="id"
> >>>>                        column="id"
> >>>>                        jdbc-type="numeric"
> >>>>                        primarykey="true"
> >>>>                        autoincrement="false"
> >>>>   access="readonly"
> >>>>                     />
> >>>>           <field-descriptor name='_Nom' column='nom'
> >>>>jdbc-type='VARCHAR'/>
> >>>></class-descriptor>
> >>>>
> >>>>here is my table
> >>>>CREATE TABLE Structure (
> >>>>
> >>>>id numeric(4,0) identity not null,
> >>>>
> >>>>nom VARCHAR(50) NULL )
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>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
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Identity

Posted by Armin Waibel <ar...@code-au-lait.de>.
which DB do you use?
the platform implementation class have to
override

public String getLastInsertIdentityQuery(String tableName)
{
    // return the sql string to query last inserted Identity value
}

regards,
Armin

Rémi Bars wrote:

> hi,
> 
> i have done the change and all my records are in the database. But now i get
> this error :
> 
> what does it mean?
> 
> thanks !
> 
> remi
> 
> org.apache.ojb.broker.util.sequence.SequenceManagerException:
> java.lang.UnsupportedOperationException: This feature is not supported by
> this implementation
> 
>  at
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
> Unknown Source)
> 
>  at
> org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
> nown Source)
> 
>  at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
> Impl.java:1985)
> 
>  at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> .java:1891)
> 
>  at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
> .java:1849)
> 
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
> 
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
> 
>  at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)
> 
>  at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
> Source)
> 
>  at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)
> 
>  at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown Source)
> 
>  at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)
> 
>  at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)
> 
> 
> ----- Original Message ----- 
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Wednesday, November 26, 2003 6:24 PM
> Subject: Re: Identity
> 
> 
> 
>>doh! Seems I'm tired or dumb ;-)
>>I mean autoincrement="true"
>>Or did you implement your owm sequence manager?
>>
>>abashed,
>>Armin
>>
>>Armin Waibel wrote:
>>
>>
>>>Hi,
>>>
>>>assume you are using SequenceManagerNativeImpl?
>>>Please set primarykey="true"
>>>Which OJB version?
>>>
>>>regards
>>>Armin
>>>
>>>Rémi Bars wrote:
>>>
>>>
>>>>Hi all,
>>>>
>>>>i m trying to use identity on sybase with the odmg api. I don t
>>>>understand
>>>>why only one object is insert in my table, when i try to add a second
>>>>object
>>>>i get no error but no record too.
>>>>
>>>>have u an idea?
>>>>
>>>>thanks for ur help!
>>>>
>>>>here is my repository
>>>>
>>>><class-descriptor class='Structure' table='Structure' >
>>>>           <field-descriptor
>>>>                        name="id"
>>>>                        column="id"
>>>>                        jdbc-type="numeric"
>>>>                        primarykey="true"
>>>>                        autoincrement="false"
>>>>   access="readonly"
>>>>                     />
>>>>           <field-descriptor name='_Nom' column='nom'
>>>>jdbc-type='VARCHAR'/>
>>>></class-descriptor>
>>>>
>>>>here is my table
>>>>CREATE TABLE Structure (
>>>>
>>>>id numeric(4,0) identity not null,
>>>>
>>>>nom VARCHAR(50) NULL )
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Identity

Posted by Rémi Bars <rb...@softeam.fr>.
hi,

i have done the change and all my records are in the database. But now i get
this error :

what does it mean?

thanks !

remi

org.apache.ojb.broker.util.sequence.SequenceManagerException:
java.lang.UnsupportedOperationException: This feature is not supported by
this implementation

 at
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.getLastInsert(
Unknown Source)

 at
org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl.afterStore(Unk
nown Source)

 at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroker
Impl.java:1985)

 at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
.java:1891)

 at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl
.java:1849)

 at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)

 at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)

 at org.apache.ojb.odmg.states.StateNewDirty.commit(Unknown Source)

 at org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(Unknown
Source)

 at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(Unknown Source)

 at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(Unknown Source)

 at org.apache.ojb.odmg.TransactionImpl.prepare(Unknown Source)

 at org.apache.ojb.odmg.TransactionImpl.commit(Unknown Source)


----- Original Message ----- 
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Wednesday, November 26, 2003 6:24 PM
Subject: Re: Identity


> doh! Seems I'm tired or dumb ;-)
> I mean autoincrement="true"
> Or did you implement your owm sequence manager?
>
> abashed,
> Armin
>
> Armin Waibel wrote:
>
> > Hi,
> >
> > assume you are using SequenceManagerNativeImpl?
> > Please set primarykey="true"
> > Which OJB version?
> >
> > regards
> > Armin
> >
> > Rémi Bars wrote:
> >
> >> Hi all,
> >>
> >> i m trying to use identity on sybase with the odmg api. I don t
> >> understand
> >> why only one object is insert in my table, when i try to add a second
> >> object
> >> i get no error but no record too.
> >>
> >> have u an idea?
> >>
> >> thanks for ur help!
> >>
> >> here is my repository
> >>
> >> <class-descriptor class='Structure' table='Structure' >
> >>            <field-descriptor
> >>                         name="id"
> >>                         column="id"
> >>                         jdbc-type="numeric"
> >>                         primarykey="true"
> >>                         autoincrement="false"
> >>    access="readonly"
> >>                      />
> >>            <field-descriptor name='_Nom' column='nom'
> >> jdbc-type='VARCHAR'/>
> >> </class-descriptor>
> >>
> >> here is my table
> >> CREATE TABLE Structure (
> >>
> >> id numeric(4,0) identity not null,
> >>
> >> nom VARCHAR(50) NULL )
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>


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


Re: Identity

Posted by Armin Waibel <ar...@code-au-lait.de>.
doh! Seems I'm tired or dumb ;-)
I mean autoincrement="true"
Or did you implement your owm sequence manager?

abashed,
Armin

Armin Waibel wrote:

> Hi,
> 
> assume you are using SequenceManagerNativeImpl?
> Please set primarykey="true"
> Which OJB version?
> 
> regards
> Armin
> 
> Rémi Bars wrote:
> 
>> Hi all,
>>
>> i m trying to use identity on sybase with the odmg api. I don t 
>> understand
>> why only one object is insert in my table, when i try to add a second 
>> object
>> i get no error but no record too.
>>
>> have u an idea?
>>
>> thanks for ur help!
>>
>> here is my repository
>>
>> <class-descriptor class='Structure' table='Structure' >
>>            <field-descriptor
>>                         name="id"
>>                         column="id"
>>                         jdbc-type="numeric"
>>                         primarykey="true"
>>                         autoincrement="false"
>>    access="readonly"
>>                      />
>>            <field-descriptor name='_Nom' column='nom' 
>> jdbc-type='VARCHAR'/>
>> </class-descriptor>
>>
>> here is my table
>> CREATE TABLE Structure (
>>
>> id numeric(4,0) identity not null,
>>
>> nom VARCHAR(50) NULL )
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Identity

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi,

assume you are using SequenceManagerNativeImpl?
Please set primarykey="true"
Which OJB version?

regards
Armin

Rémi Bars wrote:

> Hi all,
> 
> i m trying to use identity on sybase with the odmg api. I don t understand
> why only one object is insert in my table, when i try to add a second object
> i get no error but no record too.
> 
> have u an idea?
> 
> thanks for ur help!
> 
> here is my repository
> 
> <class-descriptor class='Structure' table='Structure' >
>            <field-descriptor
>                         name="id"
>                         column="id"
>                         jdbc-type="numeric"
>                         primarykey="true"
>                         autoincrement="false"
>    access="readonly"
>                      />
>            <field-descriptor name='_Nom' column='nom' jdbc-type='VARCHAR'/>
> </class-descriptor>
> 
> here is my table
> CREATE TABLE Structure (
> 
> id numeric(4,0) identity not null,
> 
> nom VARCHAR(50) NULL )
> 
> 
> ---------------------------------------------------------------------
> 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


Identity

Posted by Rémi Bars <rb...@softeam.fr>.
Hi all,

i m trying to use identity on sybase with the odmg api. I don t understand
why only one object is insert in my table, when i try to add a second object
i get no error but no record too.

have u an idea?

thanks for ur help!

here is my repository

<class-descriptor class='Structure' table='Structure' >
           <field-descriptor
                        name="id"
                        column="id"
                        jdbc-type="numeric"
                        primarykey="true"
                        autoincrement="false"
   access="readonly"
                     />
           <field-descriptor name='_Nom' column='nom' jdbc-type='VARCHAR'/>
</class-descriptor>

here is my table
CREATE TABLE Structure (

id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )


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


RE: proxy ClassCastException

Posted by Ken Brewer <kb...@microremedies.com>.
Did you find this thread
http://www.mail-archive.com/ojb-user@db.apache.org/msg06219.html in the
archive. It solved all my proxy problems thus far.

-Ken

> -----Original Message-----
> From: Glauber Andrade [mailto:glauber@maximasti.com.br]
> Sent: Wednesday, November 26, 2003 10:28 AM
> To: ojb-user@db.apache.org
> Subject: proxy ClassCastException
> Importance: High
>
>
> I am trying to use proxy (my first time) and I am getting a
> ClassCastException.
> What do I need to do? How do I cast ?
> Thanks,
>
> Glauber
>
> ////////////////////////////////////
>       Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
>       Collection c = broker.getCollectionByQuery(q);
>       Iterator iter = c.iterator();
>       Object[][] data = new Object[c.size()][17];
>       NotaRecibo nota = null;
>       while (iter.hasNext()) {
>          nota = (NotaRecibo) iter.next();    ===> ClassCastException
>          ...
> ////////////////////////////////////
>    <class-descriptor
>       class="com......data.NotaRecibo"
>      proxy="dynamic"
>       table="notasrecibos"
>    >
> ...
> ////////////////////////////////////
> public interface InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
> public class NotaRecibo implements InterfaceNotaRecibo {
> ...
> ////////////////////////////////////
>
>
> ---------------------------------------------------------------------
> 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


proxy ClassCastException

Posted by Glauber Andrade <gl...@maximasti.com.br>.
I am trying to use proxy (my first time) and I am getting a
ClassCastException.
What do I need to do? How do I cast ?
Thanks,

Glauber

////////////////////////////////////
      Query q = QueryFactory.newQuery(NotaRecibo.class, crit);
      Collection c = broker.getCollectionByQuery(q);
      Iterator iter = c.iterator();
      Object[][] data = new Object[c.size()][17];
      NotaRecibo nota = null;
      while (iter.hasNext()) {
         nota = (NotaRecibo) iter.next();    ===> ClassCastException
         ...
////////////////////////////////////
   <class-descriptor
      class="com......data.NotaRecibo"
     proxy="dynamic"
      table="notasrecibos"
   >
...
////////////////////////////////////
public interface InterfaceNotaRecibo {
...
////////////////////////////////////
public class NotaRecibo implements InterfaceNotaRecibo {
...
////////////////////////////////////


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


Re: RC3 x RC4 ?

Posted by Justis Peters <ju...@oculan.com>.
Hi Glauber,

In my experience, yes it does help performance to use proxies.  If you have any "composite" objects in your object model, using proxies helps a lot.  This way, if you are simply displaying an index of all objects of one type, it only has to load the object itself and not any of its component objects.  The component objects will be loaded only once you attempt to access to component.  I would recommend, however, that you consider whether or not to use a proxy on a class-by-class basis.  Some of your simpler classes would get slower if you use a proxy.  For the more complex classes, though, you will see amazing speed increases by using a proxy.

Additionally, tweaking you cache settings can help a lot.  I have taken some of my more complex classes and run continuous access/display loops (using "while (true)" loops) just to test the speed.  After the first few runs through the loop, things speed up drastically.  I imagine this is because my objects are retrieved from the cache instead of from the database.

I see no reason to shy away from RC4 for performance reasons.  Good tweaking of proxies and cache should get such a performance gain over JDBC that you will never notice the difference.  The user who mentioned problems with performance earlier may have simply lost some of the cache and proxy settings that had made RC3 work so well him.

Make yourself some good test classes and run them using different proxy and cache settings.  I'll think you'll find some settings that work really well for you.

Enjoy!

Justis Peters
Oculan Corp.
www.oculan.com

Glauber Andrade [glauber@maximasti.com.br] wrote:
> Ok.
> One more question... I am not using proxy classes. Would the performance be
> better if I use it ?
> Thanks,
> 
> Glauber
> 
> ----- Original Message -----
> From: "Justis Peters" <ju...@oculan.com>
> To: "Glauber Andrade" <gl...@maximasti.com.br>
> Sent: Thursday, October 02, 2003 11:42 AM
> Subject: Re: RC3 x RC4 ?
> 
> 
> > Hi Glauber,
> >
> > Hopefully someone else will answer your question.  I have started using
> OJB only with version RC4, so I am not familiar with the previous versions.
> Performance has been excellent, however, in comparison to the JDBC queries I
> had.  Most of the performance gains have been due to intelligent use of the
> proxy classes.
> >
> > Enjoy!
> >
> > Justis Peters
> >
> > Glauber Andrade [glauber@maximasti.com.br] wrote:
> > > Hi,
> > >
> > > Thanks.
> > > I only want to know if the new version is better, because i read some
> emails
> > > talking about the RC4 being slower than RC3... Should I change it ?
> > >
> > > Thanks,
> > >
> > > Glauber
> > >
> > > ----- Original Message -----
> > > From: "Justis Peters" <ju...@oculan.com>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Thursday, October 02, 2003 11:26 AM
> > > Subject: Re: RC3 x RC4 ?
> > >
> > >
> > > > Hi Glauber,
> > > >
> > > > Please read the "release-notes.txt" file that is included with each
> > > distribution.  It includes details about what is new in each release, up
> to
> > > including the release that you downloaded.
> > > >
> > > > Thanks,
> > > > Justis Peters
> > > >
> > > > Glauber Andrade [glauber@maximasti.com.br] wrote:
> > > > > Hi list,
> > > > >
> > > > > We are using the RC3 version in our system, it would be better if we
> > > change
> > > > > it to RC4 ?
> > > > > What are the advantages in the RC4 version?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Glauber
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > 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

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


Re: RC3 x RC4 ?

Posted by Glauber Andrade <gl...@maximasti.com.br>.
Hi,

Thanks.
I only want to know if the new version is better, because i read some emails
talking about the RC4 being slower than RC3... Should I change it ?

Thanks,

Glauber

----- Original Message -----
From: "Justis Peters" <ju...@oculan.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, October 02, 2003 11:26 AM
Subject: Re: RC3 x RC4 ?


> Hi Glauber,
>
> Please read the "release-notes.txt" file that is included with each
distribution.  It includes details about what is new in each release, up to
including the release that you downloaded.
>
> Thanks,
> Justis Peters
>
> Glauber Andrade [glauber@maximasti.com.br] wrote:
> > Hi list,
> >
> > We are using the RC3 version in our system, it would be better if we
change
> > it to RC4 ?
> > What are the advantages in the RC4 version?
> >
> > Thanks,
> >
> > Glauber
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: RC3 x RC4 ?

Posted by Justis Peters <ju...@oculan.com>.
Hi Glauber,

Please read the "release-notes.txt" file that is included with each distribution.  It includes details about what is new in each release, up to including the release that you downloaded.

Thanks,
Justis Peters

Glauber Andrade [glauber@maximasti.com.br] wrote:
> Hi list,
> 
> We are using the RC3 version in our system, it would be better if we change
> it to RC4 ?
> What are the advantages in the RC4 version?
> 
> Thanks,
> 
> Glauber
> 
> 
> ---------------------------------------------------------------------
> 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


RC3 x RC4 ?

Posted by Glauber Andrade <gl...@maximasti.com.br>.
Hi list,

We are using the RC3 version in our system, it would be better if we change
it to RC4 ?
What are the advantages in the RC4 version?

Thanks,

Glauber


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


Re: PROGRESS ?

Posted by Mark Berry <ma...@labpro2000.com>.
No use the JDBC driver that ships with Progress.

Mark

----- Original Message ----- 
From: "Glauber Andrade" <gl...@maximasti.com.br>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, September 16, 2003 1:27 PM
Subject: Re: PROGRESS ?


> Hi Mark,
>
> Are you using the HSQL driver too, or a Progress driver ?
> Thanks,
>
> Glauber
>
>
> ----- Original Message -----
> From: "Mark Berry" <ma...@labpro2000.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, September 15, 2003 6:50 PM
> Subject: Re: PROGRESS ?
>
>
> > Hi Glauber
> >
> >     We are using Progress 9.1D06 and OJB.
> >     We have set it up to use the HSQL database.
> >
> >     The only problem we have come across is in writing records with null
> or
> > zero length fields in the primary key.
> >     Apart from that it appears to perform really well.
> >
> > Regards
> >
> > Mark Berry
> >
> > ----- Original Message -----
> > From: "Glauber Andrade" <gl...@maximasti.com.br>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Tuesday, September 16, 2003 7:20 AM
> > Subject: PROGRESS ?
> >
> >
> > > Hi,
> > >
> > > Does the OJB work with Progress Database (Progress 9.1B) ?
> > > Thanks,
> > >
> > > Glauber
>
>
>
> ---------------------------------------------------------------------
> 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


Re: PROGRESS ?

Posted by Glauber Andrade <gl...@maximasti.com.br>.
Hi Mark,

Are you using the HSQL driver too, or a Progress driver ?
Thanks,

Glauber


----- Original Message -----
From: "Mark Berry" <ma...@labpro2000.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, September 15, 2003 6:50 PM
Subject: Re: PROGRESS ?


> Hi Glauber
>
>     We are using Progress 9.1D06 and OJB.
>     We have set it up to use the HSQL database.
>
>     The only problem we have come across is in writing records with null
or
> zero length fields in the primary key.
>     Apart from that it appears to perform really well.
>
> Regards
>
> Mark Berry
>
> ----- Original Message -----
> From: "Glauber Andrade" <gl...@maximasti.com.br>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Tuesday, September 16, 2003 7:20 AM
> Subject: PROGRESS ?
>
>
> > Hi,
> >
> > Does the OJB work with Progress Database (Progress 9.1B) ?
> > Thanks,
> >
> > Glauber



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


Re: PROGRESS ?

Posted by Mark Berry <ma...@labpro2000.com>.
Hi Glauber

    We are using Progress 9.1D06 and OJB.
    We have set it up to use the HSQL database.

    The only problem we have come across is in writing records with null or
zero length fields in the primary key.
    Apart from that it appears to perform really well.

Regards

Mark Berry

----- Original Message ----- 
From: "Glauber Andrade" <gl...@maximasti.com.br>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, September 16, 2003 7:20 AM
Subject: PROGRESS ?


> Hi,
>
> Does the OJB work with Progress Database (Progress 9.1B) ?
> Thanks,
>
> Glauber
>
>
>
>
> ---------------------------------------------------------------------
> 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