Re: identity column

2005-05-18 Thread Martin Kalén
Vagula wrote:
I have an identity column in my database.
Lets day for example in Activity table we have identity
column act_code.
What are the steps I should be following?
Do you want to:
a) just map ACTIVITY.ACT_CODE as primary key in OJB?
b) use database sequence-assigned primary key values in OJB?
c) ... [fill in your question of choice] ... :)
If a, check out the mapping tutorial [1] and repository section
of the OJB website, specifically @primarykey of the
field-descriptor element. [2]
If b, see the RDBMS sequence HOWTO. [3]
Otherwise, try to elaborate a bit more on your problem.
Regards,
 Martin
[1] http://db.apache.org/ojb/docu/tutorials/mapping-tutorial.html
[2] http://db.apache.org/ojb/docu/guides/repository.html
[3] http://db.apache.org/ojb/docu/howtos/howto-use-db-sequences.html
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: identity column !! Please Help!!

2005-05-13 Thread Armin Waibel
Hi Vagula,
Vagula wrote:
Hi All,
I have an identity column in my database.
Lets day for example in Activity table we have identity
column act_code.
What are the steps I should be following?
Please have a look in sequence documentation
http://db.apache.org/ojb/docu/guides/sequencemanager.html#Identity+based+sequence+manager
This section describe how to use database identity columns as PK in 
persistent capable objects.

regards,
Armin

Please Help
TIA
 

Regards,
Vagula
 

 



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


Re: Identity

2004-02-10 Thread Rémi Bars
i ll test it soon in a distributed application, and post my result here:)

Remi

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
> > [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Identity

2004-02-10 Thread Armin Waibel
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
[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Identity

2004-02-10 Thread Rémi Bars
> 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
[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Identity

2004-02-10 Thread Armin Waibel
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Identity

2004-02-10 Thread Rémi Bars


 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Identity

2004-02-10 Thread Armin Waibel
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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


[EMAIL PROTECTED]

for WRITE
at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
thanks

remi

- Original Message - 
From: "Rémi Bars" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 5:45 PM
Subject: Re: Identity



ok thanks it works fine now

Remi

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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 So

Re: Identity

2004-02-10 Thread Rémi Bars
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> 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
> >
>
[EMAIL PROTECTED]
> > for WRITE
> >  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
> >
> > thanks
> >
> > remi
> >
> >
> > - Original Message - 
> > From: "Rémi Bars" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > Sent: Thursday, November 27, 2003 5:45 PM
> > Subject: Re: Identity
> >
> >
> > > ok thanks it works fine now
> > >
> > > Remi
> > >
> > > - Original Message - 
> > > From: "Armin Waibel" <[EMAIL PROTECTED]>
> > > To: "OJB Users List" <[EMAIL PROTECTED]>
> > > 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
> > > > > [EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
> > > > > To: "OJB Users List" <[EMAIL PROTECTED]>
> > > > > Sent: Thursday, November 27, 2003 10:02 AM
> > > > > Subject: Re: Identity
> > > > >
> > > > >
> > > > >
> > > > >>i m using sybase
> > > > >>
> > > > >&

Re: Identity

2004-02-10 Thread Armin Waibel
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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

[EMAIL PROTECTED]

for WRITE
at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
thanks

remi

- Original Message - 
From: "Rémi Bars" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 5:45 PM
Subject: Re: Identity



ok thanks it works fine now

Remi

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
A

Re: Identity

2004-02-10 Thread Rémi Bars
sorry it works fine now i have found a old code in my ojb

Remi
- Original Message - 
From: "Rémi Bars" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
>
[EMAIL PROTECTED]
> for WRITE
>  at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source
>
> thanks
>
> remi
>
>
> - Original Message - 
> From: "Rémi Bars" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, November 27, 2003 5:45 PM
> Subject: Re: Identity
>
>
> > ok thanks it works fine now
> >
> > Remi
> >
> > - Original Message - 
> > From: "Armin Waibel" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > 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
> > > > [EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
> > > > To: "OJB Users List" <[EMAIL PROTECTED]>
> > > > 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" <[EMAIL PROTECTED]>
> > > >>To: "OJB Users List" <[EMAIL PROTECTED]>
> > > >>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
> > > >>>}
> > > >>>
> > > &

Re: Identity

2004-02-10 Thread Rémi Bars
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
[EMAIL PROTECTED]
for WRITE
 at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source

thanks

remi


- Original Message - 
From: "Rémi Bars" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 5:45 PM
Subject: Re: Identity


> ok thanks it works fine now
>
> Remi
>
> - Original Message - 
> From: "Armin Waibel" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> 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
> > > [EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
> > > To: "OJB Users List" <[EMAIL PROTECTED]>
> > > 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" <[EMAIL PROTECTED]>
> > >>To: "OJB Users List" <[EMAIL PROTECTED]>
> > >>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
> > >>
> > >>&

RE: Identity with double column primary key

2004-02-05 Thread Guillaume Nodet
Sorry, the order of my primary keys in the repository have changed...

-Message d'origine-
De : Guillaume Nodet [mailto:[EMAIL PROTECTED]
Envoye : jeudi 5 fevrier 2004 15:09
A : OJB Users List
Objet : Identity with double column primary key


I'm using double column primary keys.
When i retrieve an object with the getObjectByIdentity, 
i construct a new Identity object giving the two values
for my columns. The problem is that i ran some tests on
another computer, and the sql statements was badly built.
Ojb had inverted the values assignements to the columns.
So my question is: how can i know the order of the 
primary key columns when building an Identity ?

Regards,

Guillaume


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





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



Re: Identity

2003-11-27 Thread Rémi Bars
ok thanks it works fine now

Remi

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
> > [EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > 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" <[EMAIL PROTECTED]>
> >>To: "OJB Users List" <[EMAIL PROTECTED]>
> >>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(U

Re: Identity

2003-11-27 Thread Armin Waibel
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
[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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


 
 

here is my table
CREATE TABLE Structure (
id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )



-

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




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




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



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




-
To unsubscribe, e-mail: [EM

Re: Identity

2003-11-27 Thread Rémi Bars
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
[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> 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" <[EMAIL PROTECTED]>
> > > To: "OJB Users List" <[EMAIL PROTECTED]>
> > > 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
> > >>>>

Re: Identity

2003-11-27 Thread Rémi Bars
ok i see nothing about this method in PlatformSybaseASEImpl.java..


- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > 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
> >>>>
> >>>>
> >>>>>>>>name="id"
> >>>>column="id"
> >>>>jdbc-type="numeric"
> >>>>primarykey="true"
> >>>>autoincrement="false"
> >>>>   access="readonly"
> >>>> />
> >>>>>>>>jdbc-type='VARCHAR'/>
> >>>>
> >>>>
> >>>>here is my table
> >>>>CREATE TABLE Structure (
> >>>>
> >>>>id numeric(4,0) identity not null,
> >>>>
> >>>>nom VARCHAR(50) NULL )
> >>>>
> >>>>
> >>>>-
> >>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Identity

2003-11-27 Thread Armin Waibel
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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


 
 

here is my table
CREATE TABLE Structure (
id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )

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




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




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



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




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



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




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


Re: Identity

2003-11-27 Thread Rémi Bars
i m using sybase

where can i find the platformù implementation?

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > 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
> >>>>
> >>>>
> >>>>>>>>name="id"
> >>>>column="id"
> >>>>jdbc-type="numeric"
> >>>>primarykey="true"
> >>>>autoincrement="false"
> >>>>   access="readonly"
> >>>> />
> >>>>>>>>jdbc-type='VARCHAR'/>
> >>>>
> >>>>
> >>>>here is my table
> >>>>CREATE TABLE Structure (
> >>>>
> >>>>id numeric(4,0) identity not null,
> >>>>
> >>>>nom VARCHAR(50) NULL )
> >>>>
> >>>>
> >>>>-
> >>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Identity

2003-11-27 Thread Armin Waibel
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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


  
  

here is my table
CREATE TABLE Structure (
id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )

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




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




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



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




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


Re: Identity

2003-11-27 Thread Rémi Bars
i forgot this : i m using ojb rc4

remi

- Original Message - 
From: "Rémi Bars" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> 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
> > >>
> > >> 
> > >> > >> name="id"
> > >> column="id"
> > >> jdbc-type="numeric"
> > >> primarykey="true"
> > >> autoincrement="false"
> > >>access="readonly"
> > >>  />
> > >> > >> jdbc-type='VARCHAR'/>
> > >> 
> > >>
> > >> here is my table
> > >> CREATE TABLE Structure (
> > >>
> > >> id numeric(4,0) identity not null,
> > >>
> > >> nom VARCHAR(50) NULL )
> > >>
> > >>
> > >> -
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Identity

2003-11-27 Thread Rémi Bars
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" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
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
> >>
> >> 
> >> >> name="id"
> >> column="id"
> >> jdbc-type="numeric"
> >> primarykey="true"
> >> autoincrement="false"
> >>access="readonly"
> >>  />
> >> >> jdbc-type='VARCHAR'/>
> >> 
> >>
> >> here is my table
> >> CREATE TABLE Structure (
> >>
> >> id numeric(4,0) identity not null,
> >>
> >> nom VARCHAR(50) NULL )
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Identity

2003-11-26 Thread Armin Waibel
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


   
name="id"
column="id"
jdbc-type="numeric"
primarykey="true"
autoincrement="false"
   access="readonly"
 />
   


here is my table
CREATE TABLE Structure (
id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )

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




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




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


Re: Identity

2003-11-26 Thread Armin Waibel
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


   
   

here is my table
CREATE TABLE Structure (
id numeric(4,0) identity not null,

nom VARCHAR(50) NULL )

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




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


Re: Identity Columns

2003-09-18 Thread LAURENT Stephane
Hi,
Tell us more !
Exception ?
Repository config ?
Is your DB column auto increment ?

No problems using HighLowSequence.
Simply declare ID column as primary key (not auto increment by DB), OJB automaticaly 
allow the value.

Regards.

  - Original Message - 
  From: shibin ck 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, September 18, 2003 4:43 PM
  Subject: Identity Columns


  Hi,
 I have a class with primary key as Identity column. Whenever i try to store 
an object of this class to database, ojb is throwing exception. I have tried it with 
autoincrement="true" also. Im using DB2 with j2ee, and i dont know which sequence 
manager to use. 
   
  Thanks in advance
  shibin


  -
  Do you Yahoo!?
  Yahoo! SiteBuilder - Free, easy-to-use web site design software


  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.519 / Virus Database: 317 - Release Date: 17/09/2003

Re: Identity Columns

2003-09-18 Thread Michael Becke
Hi Shibin,

You will have to make a few small changes to get identity columns 
working with DB2.  In particular you will need to:

 - make all identity columns read-only via the field-descriptor access 
attribute.
 - patch PlatformDb2Impl to implement getLastInsertIdentityQuery() 
(patch attached)
 - use SequenceManagerNativeImpl
 - patch SequenceManagerNativeImpl to ignore classes that don't have 
identity fields (patch attached)

This will get the basics working.

Mike




On Thursday, September 18, 2003, at 10:43 AM, shibin ck wrote:

Hi,
   I have a class with primary key as Identity column. Whenever i 
try to store an object of this class to database, ojb is throwing 
exception. I have tried it with autoincrement="true" also. Im using 
DB2 with j2ee, and i dont know which sequence manager to use.

Thanks in advance
shibin
-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Identity Problems.

2003-09-01 Thread Armin Waibel
Please, can you post the whole stack trace
to make things clearer?

Armin
- Original Message -
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Monday, September 01, 2003 3:14 PM
Subject: Re: Identity Problems.


> Hi Onno,
>
> seems like a PB leak or a to small PB-pool
> (OJB.properties maxActive=xxx, default was 100).
>
> If you set log-level for org...broker.PersistenceBrokerFactoryImpl
> to 'info', OJB prints a message when does create a new PB instance
> (rc4, earlier versions give it a try).
> If you have a PB-leak, make sure that after use all PB instances
> were closed (broker.close() call).
>
> > suggested a problem with the Sequence Manager.
> >
> which SequenceManager implementation do you use?
>
> regards,
> Armin
>
> - Original Message -
> From: "onno" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Monday, September 01, 2003 12:55 PM
> Subject: Identity Problems.
>
>
> > Hiya!
> >
> > We've been using OJB for quite some time now, and had no problems ,
> but
> > recently the amount of people using it has increased and we get this
> error:
> >
> > "Could not init Identity for given object class
> > x.form.CompanyPresentationBooking: Borrow broker from
> > pool failed"
> >
> > I should tell you that the website running Tomcat shares the (mySQL)
> > database with
> > 2 or more directly connected Java Clients.  My fellow developper has
> > suggested a problem with the Sequence Manager.
> >
> > Maybe one of youz has encountered this message and knows where the
> problem
> > is likely to be - if we restart the website (Tomcat) the problem
> dissappear
> > for a bit but then returns after...
> >
> > Onno
> >
> >
> >
> >
>
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: Identity Problems.

2003-09-01 Thread Stefan Schlösser
Armin Waibel wrote:

If you have a PB-leak, make sure that after use all PB instances
were closed (broker.close() call).
Hi,

I had the same problem/error message and sure enough there was a leak. I 
implemented a counter of instances each time I borrowed a connection and 
monitored that regularly using an extra thread ... it gave the clue 

With each borrow I always include

finally{
releaseBroker(broker);
}
Which calls my own method to release it and update the counter. This 
ensures close even if an exception occurs.

Never had any problems since (we have something like 20-30 concurrent 
users).

Cheers,
 Stefan




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


Re: Identity Problems.

2003-09-01 Thread Armin Waibel
Hi Onno,

seems like a PB leak or a to small PB-pool
(OJB.properties maxActive=xxx, default was 100).

If you set log-level for org...broker.PersistenceBrokerFactoryImpl
to 'info', OJB prints a message when does create a new PB instance
(rc4, earlier versions give it a try).
If you have a PB-leak, make sure that after use all PB instances
were closed (broker.close() call).

> suggested a problem with the Sequence Manager.
>
which SequenceManager implementation do you use?

regards,
Armin

- Original Message -
From: "onno" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Monday, September 01, 2003 12:55 PM
Subject: Identity Problems.


> Hiya!
>
> We've been using OJB for quite some time now, and had no problems ,
but
> recently the amount of people using it has increased and we get this
error:
>
> "Could not init Identity for given object class
> x.form.CompanyPresentationBooking: Borrow broker from
> pool failed"
>
> I should tell you that the website running Tomcat shares the (mySQL)
> database with
> 2 or more directly connected Java Clients.  My fellow developper has
> suggested a problem with the Sequence Manager.
>
> Maybe one of youz has encountered this message and knows where the
problem
> is likely to be - if we restart the website (Tomcat) the problem
dissappear
> for a bit but then returns after...
>
> Onno
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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