Re: Procedure based sequencence generator repeating values (SOLVED)

2006-05-06 Thread Armin Waibel
Hi Edson, congratulation for figure out this issue and thanks for detailed description and fixed procedure. I will add a link to your last post in sequence-manager documentation and update the procedure example for mssql. regards, Armin Edson Carlos Ericksson Richter wrote: Ok, this really

Re: Procedure based sequencence generator repeating values (SOLVED)

2006-05-05 Thread Edson Carlos Ericksson Richter
Ok, this really solved. Final procedure code (works on SQL2K and SQL2K5): code CREATE PROCEDURE OJB_NEXTVAL_PROC @SEQ_NAME varchar(150) AS declare @MAX_KEY BIGINT set nocount off set @MAX_KEY = 0 UPDATE OJB_NEXTVAL_SEQ SET @MAX_KEY = MAX_KEY = MAX_KEY + 1 WHERE SEQ_NAME = @SEQ_NAME --

Re: Procedure based sequencence generator repeating values

2006-04-28 Thread Edson Carlos Ericksson Richter
Hi! I'm still with this problem. Could someone say if SequenceManagers use default connection present at current thread? Or it's executed inside same transaction (I don't know if this implies same connection)? Thanks for any clarifications! Richter Edson Carlos Ericksson Richter

Re: Procedure based sequencence generator repeating values

2006-04-28 Thread Edson Carlos Ericksson Richter
Ok, guys: now, I'm lost! I changed auto-commit from 1 to 2, and now, appear OJB is trying to insert records twice - on every new object I store, I get primary key violation! I'm using PB API with MsSQL Server 2000 SP4 and JDBC Driver for MS SQL Server 2005 latest release. Someone knows what

Re: Procedure based sequencence generator repeating values (MAYBE SOLVED)

2006-04-28 Thread Edson Carlos Ericksson Richter
Ok, guys. I think I discovered a piece of solution for this problem: 1) Database must be in Full recovery model 2) Every trigger must start with SET NOCOUNT ON and end with SET NOCOUNT OFF 3) The OBJ_NEXTVAL_PROC should start with SET NOCOUNT OFF We are in testing fase right now, but appear the

Re: Procedure based sequencence generator repeating values

2006-04-24 Thread Armin Waibel
Hi, I'm not a database expert, so please forbear with me ;-) Edson Carlos Ericksson Richter wrote: Hi! There is a very long time since my last problem with OJB - thank you guys, it's awesome how good work was done until now. In last month, I was migrating from Oracle to MS SQL, and changed

Re: Procedure based sequencence generator repeating values

2006-04-24 Thread Edson Carlos Ericksson Richter
Armin Waibel escreveu: Hi, I'm not a database expert, so please forbear with me ;-) Edson Carlos Ericksson Richter wrote: Hi! There is a very long time since my last problem with OJB - thank you guys, it's awesome how good work was done until now. In last month, I was migrating from Oracle

Procedure based sequencence generator repeating values

2006-04-22 Thread Edson Carlos Ericksson Richter
Hi! There is a very long time since my last problem with OJB - thank you guys, it's awesome how good work was done until now. In last month, I was migrating from Oracle to MS SQL, and changed from Sequence Manager Oracle native to Procedure based on MS SQL. Worked great on tests, but when in