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 Christian Eugster <ch...@gmx.net> on 2007/09/28 16:53:29 UTC

Different behaviour of SequenceManager in rc5 and 1.0.1

Hi,

In my program I updated ojb from 1.0.rc5 to 1.0.1. When I store a new record the sequence manager does not assign a value to my primary key field (autoincrement=true). With 1.0.rc5 it did it (and does it) with no problem. With 1.0.4 too there is no assigning to the autoincrement field. I use org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as Sequence Manager.

Has anybody any suggestion, what i can do?

Thanks a lot!

Christian
-- 
****************************
Christian Eugster
Grissian Widum 14
I-39010 Tisens
--------------------------------------
Handy Schweiz: 0041 79 594 85 45
Handy Italia: 0039 333 888 77 64
Email: christian.eugster@gmx.net


GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Christian Eugster <ch...@gmx.net>.
Hi Armin,

I got it. Thank you very much!!!

Regards

Christian

-- 
****************************
Christian Eugster
Grissian Widum 14
I-39010 Tisens
--------------------------------------
Handy Schweiz: 0041 79 594 85 45
Handy Italia: 0039 333 888 77 64
Email: christian.eugster@gmx.net


GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Armin Waibel <ar...@apache.org>.
Christian Eugster wrote:
> Hi Armin,
> 
> thank you for the hint. Now I have changed all the id field's default
> value of my objects to null instead of '0'. I updated OJB to 1.0.4
> now (good luck!). When I try to store an object I get now the
> following Exception:
> 
> [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
> PersistenceBrokerException during the execution of materializeObject:
> Can't generate primary key values for given Identity
> org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}
>  Can't generate primary key values for given Identity
> org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}
>  [org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl]
> ERROR: Can't lookup new HighLowSequence for field id using sequence
> name SEQ_pos_product_group Can't generate primary key values for
> given Identity
> org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}
> 
> 
> As I see in the documentation the table ojb_hl_seq has only changed
> the type of max_key from Integer to Bigint. 

and removed a deprecated column

>Is there another place
> where I have to look?

In the release-notes (especially section 'notes' and 'changes').
Don't forget to replace the old repository_internal.xml (and all other 
OJB config files) file with the new one shipped with 1.0.4.

regards,
Armin

> 
> Thanks!
> 
> Christian
> 

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Christian Eugster <ch...@gmx.net>.
Hi Armin,

thank you for the hint. Now I have changed all the id field's default value of my objects to null instead of '0'. I updated OJB to 1.0.4 now (good luck!). When I try to store an object I get now the following Exception:

[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: PersistenceBrokerException during the execution of materializeObject: Can't generate primary key values for given Identity org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}
Can't generate primary key values for given Identity org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}
[org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl] ERROR: Can't lookup new HighLowSequence for field id using sequence name SEQ_pos_product_group
Can't generate primary key values for given Identity org.apache.ojb.broker.util.sequence.HighLowSequence{SEQ_pos_product_group}

As I see in the documentation the table ojb_hl_seq has only changed the type of max_key from Integer to Bigint. Is there another place where I have to look?

Thanks!

Christian

-- 
****************************
Christian Eugster
Grissian Widum 14
I-39010 Tisens
--------------------------------------
Handy Schweiz: 0041 79 594 85 45
Handy Italia: 0039 333 888 77 64
Email: christian.eugster@gmx.net


GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Armin Waibel <ar...@apache.org>.
Christian Eugster wrote:
> Hi Armin,
> 
> DBResult is useless (an older story). The object is written to the
> database (a mysql 5.0 database). But the primary key always the value
> '0'. When I change back to version 1.0.rc5 the values are assigned.
>

I checked the source in OJB 1.0.4, the PK will be assigned on insert of 
the object (if the PK field value is 'NULL': 0 for primitiv field (int 
long,...), 'Null' for non-primitiv).
See this class (scroll to the end):
http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java?revision=365204&view=markup

Are the PK fields initialized with non-Null values?
When do you request the PK value of your object? Is it definitely after 
insert of the object?

regards,
Armin

> Regards
> 
> Christian
> 

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Christian Eugster <ch...@gmx.net>.
Hi Armin,

DBResult is useless (an older story). The object is written to the database (a mysql 5.0 database). But the primary key always the value '0'. When I change back to version 1.0.rc5 the values are assigned.

Regards

Christian

-- 
****************************
Christian Eugster
Grissian Widum 14
I-39010 Tisens
--------------------------------------
Handy Schweiz: 0041 79 594 85 45
Handy Italia: 0039 333 888 77 64
Email: christian.eugster@gmx.net


Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

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

the mapping seems ok. What I don't understand is the use of DBResult. 
You create a new instance of DBResult before "this" is stored by OJB and 
the DBResult instance never change - why?
Does OJB writes the object to the database?

 >> record the sequence manager does not assign a value to my primary
 >> key

How did you check this (you don't post this)?

regards,
Armin

Christian Eugster wrote:
> The mapping part ist as follows:
> 
> <class-descriptor class="ch.eugster.pos.db.ProductGroup" table="pos_product_group" isolation-level="read-uncommitted" accept-locks="true" refresh="false">
>   <field-descriptor name="id" column="id" jdbc-type="BIGINT" primarykey="true" indexed="true" access="readwrite" autoincrement="true" nullable="true" locking="false" update-lock="true" default-fetch="false" /> 
>   <field-descriptor name="timestamp" column="timestamp" jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="deleted" column="deleted" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="defaultGroup" column="default_group" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="galileoId" column="galileo_id" jdbc-type="VARCHAR" length="3" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="defaultTaxId" column="default_tax_id" jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="shortname" column="shortname" jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="name" column="name" jdbc-type="VARCHAR" length="255" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="quantityProposal" column="quantity_proposal" jdbc-type="INTEGER" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="priceProposal" column="price_proposal" jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="optCodeProposal" column="opt_code_proposal" jdbc-type="VARCHAR" length="1" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="account" column="account" jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="isIncome" column="is_income" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="isExpense" column="is_expense" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="modified" column="modified" jdbc-type="BIT" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="type" column="type" jdbc-type="INTEGER" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <field-descriptor name="exportId" column="export_id" jdbc-type="VARCHAR" length="10" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
>   <reference-descriptor name="defaultTax" class-ref="ch.eugster.pos.db.Tax" proxy="false" refresh="false" auto-retrieve="true" auto-update="false" auto-delete="false" otm-dependent="false">
>   <foreignkey field-ref="defaultTaxId" /> 
>   </reference-descriptor>
> </class-descriptor>
> 
> (but the same problem is for every class/table)
> 
> the code saving a new Object is:
> 
> 	public DBResult store(Connection connection) {
> 		PersistenceBroker broker = connection.getBroker();
> 		DBResult result = new DBResult();
> 		boolean isMyTransaction = !broker.isInTransaction();
> 		try {
> 			if (isMyTransaction) {
> 				broker.beginTransaction();
> 			}
> 
> 			broker.store(this);
> 
> 			if (isMyTransaction) {
> 				broker.commitTransaction();
> 			}
> 		}
> 		catch (PersistenceBrokerException e) {
> 			if (isMyTransaction) {
> 				broker.abortTransaction();
> 			}
> 
> 			if (e instanceof ClassNotPersistenceCapableException) {
> 				testSwitchDatabase();
> 			}
> 			else if (isMyTransaction) {
> 				result = describeError(e);
> 				if (e instanceof PersistenceBrokerSQLException) {
> 					PersistenceBrokerSQLException psqle = (PersistenceBrokerSQLException) e;
> 					if (psqle.getSourceException() instanceof SQLException) {
> 						SQLException sqle = (SQLException) psqle.getSourceException();
> 						//result = describeError(sqle);
> //							if (sqle.getSQLState().equals("08S01")) { //$NON-NLS-1$
> 							testSwitchDatabase();
> //							}
> 					}
> 				}
> 			}
> 		}
> 		return result;
> 	}
> 
> and the code that sets the connection is:
> 
> 	public void setConnection(JdbcConnectionDescriptor cd, Element el) {
> 		cd.setJcdAlias(el.getAttributeValue("jcd-alias")); //$NON-NLS-1$
> 		cd.setDefaultConnection(Boolean.getBoolean(el.getAttributeValue("default-connection"))); //$NON-NLS-1$
> 		cd.setDbms(el.getAttributeValue("platform")); //$NON-NLS-1$
> 		cd.setJdbcLevel(el.getAttributeValue("jdbc-level")); //$NON-NLS-1$
> 		cd.setDriver(el.getAttributeValue("driver")); //$NON-NLS-1$
> 		cd.setProtocol(el.getAttributeValue("protocol")); //$NON-NLS-1$
> 		cd.setSubProtocol(el.getAttributeValue("subprotocol")); //$NON-NLS-1$
> 		StringBuffer sb = new StringBuffer("//"); //$NON-NLS-1$
> 		sb.append(el.getAttributeValue("host")); //$NON-NLS-1$
> 		sb.append(":"); //$NON-NLS-1$
> 		sb.append(el.getAttributeValue("port")); //$NON-NLS-1$
> 		if (el.getAttributeValue("database").length() > 0) { //$NON-NLS-1$
> 			sb.append("/"); //$NON-NLS-1$
> 			sb.append(el.getAttributeValue("database")); //$NON-NLS-1$
> 		}
> 		sb.append(el.getAttributeValue("options")); //$NON-NLS-1$
> //		cd.addAttribute("autoReconnect", "true");
> 		cd.setDbAlias(sb.toString());
> 		cd.setUserName(el.getAttributeValue("username")); //$NON-NLS-1$
> 		cd.setPassWord(el.getAttributeValue("password")); //$NON-NLS-1$
> 		cd.setBatchMode(Boolean.getBoolean(el.getAttributeValue("batch-mode"))); //$NON-NLS-1$
> 		cd.setUseAutoCommit(Integer.parseInt(el.getAttributeValue("use-auto-commit"))); //$NON-NLS-1$
> 		ConnectionPoolDescriptor cpd = cd.getConnectionPoolDescriptor();
> 		SequenceDescriptor sd = new SequenceDescriptor(cd);
> 		sd.setSequenceManagerClass(org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.class);
> 		sd.addAttribute("grabSize", "20");
> 	}
> 
> 
> Thanks
> 
> Christian
> -------- Original-Nachricht --------
>> Datum: Fri, 28 Sep 2007 17:23:29 +0200
>> Von: Armin Waibel <ar...@apache.org>
>> An: OJB Users List <oj...@db.apache.org>
>> Betreff: Re: Different behaviour of SequenceManager in rc5 and 1.0.1
> 
>> Hi Christian,
>>
>> Christian Eugster wrote:
>>> Hi,
>>>
>>> In my program I updated ojb from 1.0.rc5 to 1.0.1. When I store a new
>>> record the sequence manager does not assign a value to my primary key
>>> field (autoincrement=true). With 1.0.rc5 it did it (and does it) with
>>> no problem. With 1.0.4 too there is no assigning to the autoincrement
>>> field. I use
>>> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as
>>> Sequence Manager.
>>>
>>> Has anybody any suggestion, what i can do?
>>>
>> Please post the mapping (class-descriptor) of the related class and a 
>> code snip or pseudo code of the related source code (insert of the
>> object).
>>
>> regards,
>> Armin
>>
>>> Thanks a lot!
>>>
>>> Christian
>> ---------------------------------------------------------------------
>> 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: Different behaviour of SequenceManager in rc5 and 1.0.1

Posted by Christian Eugster <ch...@gmx.net>.
The mapping part ist as follows:

<class-descriptor class="ch.eugster.pos.db.ProductGroup" table="pos_product_group" isolation-level="read-uncommitted" accept-locks="true" refresh="false">
  <field-descriptor name="id" column="id" jdbc-type="BIGINT" primarykey="true" indexed="true" access="readwrite" autoincrement="true" nullable="true" locking="false" update-lock="true" default-fetch="false" /> 
  <field-descriptor name="timestamp" column="timestamp" jdbc-type="TIMESTAMP" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="deleted" column="deleted" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="defaultGroup" column="default_group" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="galileoId" column="galileo_id" jdbc-type="VARCHAR" length="3" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="defaultTaxId" column="default_tax_id" jdbc-type="BIGINT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="shortname" column="shortname" jdbc-type="VARCHAR" length="50" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="name" column="name" jdbc-type="VARCHAR" length="255" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="quantityProposal" column="quantity_proposal" jdbc-type="INTEGER" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="priceProposal" column="price_proposal" jdbc-type="DOUBLE" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="optCodeProposal" column="opt_code_proposal" jdbc-type="VARCHAR" length="1" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="account" column="account" jdbc-type="VARCHAR" length="100" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="isIncome" column="is_income" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="isExpense" column="is_expense" jdbc-type="BIT" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="modified" column="modified" jdbc-type="BIT" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="type" column="type" jdbc-type="INTEGER" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <field-descriptor name="exportId" column="export_id" jdbc-type="VARCHAR" length="10" primarykey="false" nullable="false" indexed="false" autoincrement="false" locking="false" update-lock="true" default-fetch="false" access="readwrite" /> 
  <reference-descriptor name="defaultTax" class-ref="ch.eugster.pos.db.Tax" proxy="false" refresh="false" auto-retrieve="true" auto-update="false" auto-delete="false" otm-dependent="false">
  <foreignkey field-ref="defaultTaxId" /> 
  </reference-descriptor>
</class-descriptor>

(but the same problem is for every class/table)

the code saving a new Object is:

	public DBResult store(Connection connection) {
		PersistenceBroker broker = connection.getBroker();
		DBResult result = new DBResult();
		boolean isMyTransaction = !broker.isInTransaction();
		try {
			if (isMyTransaction) {
				broker.beginTransaction();
			}

			broker.store(this);

			if (isMyTransaction) {
				broker.commitTransaction();
			}
		}
		catch (PersistenceBrokerException e) {
			if (isMyTransaction) {
				broker.abortTransaction();
			}

			if (e instanceof ClassNotPersistenceCapableException) {
				testSwitchDatabase();
			}
			else if (isMyTransaction) {
				result = describeError(e);
				if (e instanceof PersistenceBrokerSQLException) {
					PersistenceBrokerSQLException psqle = (PersistenceBrokerSQLException) e;
					if (psqle.getSourceException() instanceof SQLException) {
						SQLException sqle = (SQLException) psqle.getSourceException();
						//result = describeError(sqle);
//							if (sqle.getSQLState().equals("08S01")) { //$NON-NLS-1$
							testSwitchDatabase();
//							}
					}
				}
			}
		}
		return result;
	}

and the code that sets the connection is:

	public void setConnection(JdbcConnectionDescriptor cd, Element el) {
		cd.setJcdAlias(el.getAttributeValue("jcd-alias")); //$NON-NLS-1$
		cd.setDefaultConnection(Boolean.getBoolean(el.getAttributeValue("default-connection"))); //$NON-NLS-1$
		cd.setDbms(el.getAttributeValue("platform")); //$NON-NLS-1$
		cd.setJdbcLevel(el.getAttributeValue("jdbc-level")); //$NON-NLS-1$
		cd.setDriver(el.getAttributeValue("driver")); //$NON-NLS-1$
		cd.setProtocol(el.getAttributeValue("protocol")); //$NON-NLS-1$
		cd.setSubProtocol(el.getAttributeValue("subprotocol")); //$NON-NLS-1$
		StringBuffer sb = new StringBuffer("//"); //$NON-NLS-1$
		sb.append(el.getAttributeValue("host")); //$NON-NLS-1$
		sb.append(":"); //$NON-NLS-1$
		sb.append(el.getAttributeValue("port")); //$NON-NLS-1$
		if (el.getAttributeValue("database").length() > 0) { //$NON-NLS-1$
			sb.append("/"); //$NON-NLS-1$
			sb.append(el.getAttributeValue("database")); //$NON-NLS-1$
		}
		sb.append(el.getAttributeValue("options")); //$NON-NLS-1$
//		cd.addAttribute("autoReconnect", "true");
		cd.setDbAlias(sb.toString());
		cd.setUserName(el.getAttributeValue("username")); //$NON-NLS-1$
		cd.setPassWord(el.getAttributeValue("password")); //$NON-NLS-1$
		cd.setBatchMode(Boolean.getBoolean(el.getAttributeValue("batch-mode"))); //$NON-NLS-1$
		cd.setUseAutoCommit(Integer.parseInt(el.getAttributeValue("use-auto-commit"))); //$NON-NLS-1$
		ConnectionPoolDescriptor cpd = cd.getConnectionPoolDescriptor();
		SequenceDescriptor sd = new SequenceDescriptor(cd);
		sd.setSequenceManagerClass(org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl.class);
		sd.addAttribute("grabSize", "20");
	}


Thanks

Christian
-------- Original-Nachricht --------
> Datum: Fri, 28 Sep 2007 17:23:29 +0200
> Von: Armin Waibel <ar...@apache.org>
> An: OJB Users List <oj...@db.apache.org>
> Betreff: Re: Different behaviour of SequenceManager in rc5 and 1.0.1

> Hi Christian,
> 
> Christian Eugster wrote:
> > Hi,
> > 
> > In my program I updated ojb from 1.0.rc5 to 1.0.1. When I store a new
> > record the sequence manager does not assign a value to my primary key
> > field (autoincrement=true). With 1.0.rc5 it did it (and does it) with
> > no problem. With 1.0.4 too there is no assigning to the autoincrement
> > field. I use
> > org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as
> > Sequence Manager.
> > 
> > Has anybody any suggestion, what i can do?
> > 
> 
> Please post the mapping (class-descriptor) of the related class and a 
> code snip or pseudo code of the related source code (insert of the
> object).
> 
> regards,
> Armin
> 
> > Thanks a lot!
> > 
> > Christian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org

-- 
****************************
Christian Eugster
Grissian Widum 14
I-39010 Tisens
--------------------------------------
Handy Schweiz: 0041 79 594 85 45
Handy Italia: 0039 333 888 77 64
Email: christian.eugster@gmx.net


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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


Re: Different behaviour of SequenceManager in rc5 and 1.0.1

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

Christian Eugster wrote:
> Hi,
> 
> In my program I updated ojb from 1.0.rc5 to 1.0.1. When I store a new
> record the sequence manager does not assign a value to my primary key
> field (autoincrement=true). With 1.0.rc5 it did it (and does it) with
> no problem. With 1.0.4 too there is no assigning to the autoincrement
> field. I use
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as
> Sequence Manager.
> 
> Has anybody any suggestion, what i can do?
> 

Please post the mapping (class-descriptor) of the related class and a 
code snip or pseudo code of the related source code (insert of the object).

regards,
Armin

> Thanks a lot!
> 
> Christian

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