Re: New connection without reason

Jess Balint <[email protected]>
Newsgroups gmane.comp.db.mysql.odbc
Message-ID <[email protected]>
Mauricio -

Do you have control over whether Clarion is using a separate connection
to execute the "select last_insert_id()" query? The driver doesn't have
any direct control of which connection is used for a specific query. If
you have some code that you can share, it might help reveal the problem.

Jess

On Mon, Dec 03, 2007 at 09:01:22AM -0300, Mauricio Bruns wrote:
> Hi,
> 
> I'm using myodbc 3.51.22, mysql 4.1.20 and Clarion. I don't know why, 
> but sometimes, without reason it (myodbc, mysql or clarion) creates a 
> new connection between two queries that couldn't be separate. For 
> example I do "INSERT INTO ...." (in a autoinc table) and after I do 
> "SELECT last_insert_id()", but each query was executed in their own 
> connection, than the second query return 0. Do you think that it could 
> be myodbc error?
> Here is some part of mysql log:
> 
> C:\Arquivos de programas\MySQL\MySQL Server 4.1\bin\mysqld-nt, Version: 
> 4.1.22-community-nt-log. started with:
> TCP Port: 3306, Named Pipe: MySQL
> Time                 Id Command    Argument
> 071129 14:52:17          1 Connect     [email protected] on Test
>              1 Query       SET SQL_AUTO_IS_NULL = 0
>              1 Query       SELECT @@tx_isolation
>              1 Query       SET SESSION TRANSACTION ISOLATION LEVEL 
> REPEATABLE READ
>              1 Query       SELECT * FROM Empresa WHERE 0 = 1
>              1 Query       SELECT 
> CodEmpresa,NomeEmpresa,CodSistema,NrUsuarios,DriverBD,AliqPis,AliqCofins,AliqCS,AliqIRF,VlrMinimoIRF,AliqIRLucro,PrazoIRJ,PrazoICMS,PrazoIPI,PrazoPIS,PrazoCofins,PrazoCS,PrazoFP,PrazoFGTS,PrazoINSS,VlrMinimoICMSDifer,CodFilialPadrao,SeImpressoraFilial,CodClienteINSS,CodClienteIRF,CodClientePCC,CodClienteISS,MetPrevisaoFluxo 
> FROM Empresa WHERE 0 = 1
> ...
>              1 Query       INSERT INTO NotaPed 
> (NrCadDoc,CodEmpresa,CodFilial,TipoDocto,NrNota,SerieNF,CodCliente,NrPedido,NrAtendimento) 
> VALUES (117286,1,5,1,15188,'3',23574,6344,214)
>              1 Query       Begin
>              1 Query       INSERT INTO DocIte 
> (NrCadDoc,CodEmpresa,CodFilial,TipoDocto,NrNota,SerieNF,CodCliente,NrSeqIte,CodProduto,CodVariante,CodTamanho,CodQualidade,UnidMedida,QtdePecas,QtdeMovto,PesoLiquido,PesoBruto,PrecoUnitario,PrecoUnitarioLiq,TipoOperFat,CodNatFiscal,CodProced,CodICMS,CodIPI,IncidePIS,IncideCofins,IncideCSLL,AliqICMS,CodClaFis,TaxaIPI,VlrProduto,VlrSeguro,VlrDespAces,VlrIpiNContrib,VlrBonif,VlrBonif2,VlrFrete,VlrFreteCalc,VlrOutDespesas,VlrISS,VlrIRF,VlrFunRural,VlrICMS,VlrICMSSubs,VlrICMSDifer,VlrIPI,VlrIPIDesp,VlrPIS,VlrCofins,VlrCSLL,VlrPCC,VlrINSS,VlrTaxaImportacao,VlrImpostosCobr,VlrServicoPago,VlrContabil,VlrComissao,VlrComissaoAdic,VlrEncFinanc,CodColecao,CodLocal,CodLocalDest,CodCusto,CodAplic,NrLoteProd,NrVolume,NrAtendimento,NrPedido,NrSeqPed,NrOrcam,NrSeqOrc,NrOrdem,NrSeqProd,QtdePerda,SitEstoque,TipoOperEtq,CodMensNF,CodFuncionario,CodProdutoCli,DescProduto,Observ,QtdeGrade1,QtdeGrade2,QtdeGrade3,QtdeGrade4,QtdeGrade5,QtdeGrade6,QtdeGrade7,QtdeGrade8,QtdeGrade9,QtdeGrade10,QtdeGrade11,QtdeGrade12) 
> VALUES (117286,1,5,1,15188,'3',23574,1,'20120174','','','','PC',0,1.000     
> ,0.000     ,0.000     ,23.000000        ,23.000000        
> ,'P','510202','0','00','90','S','S','S',17.00    ,'          ',0.00    
> ,23.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    
> ,0.00    ,0.00    ,0.00    ,0.00    ,3.91    ,0.00    ,0.00    ,0.00    
> ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    ,0.00    
> ,0.00    ,0.00    ,1.15    ,0.00    ,0.00    
> ,8,0,0,0,0,'',0,214,6344,1,0,0,0,0,0.000     
> ,'N','N',0,0,'','T-SHIRT','',0,0,0,0,0,0,0,0,0,0,0,0)
>            131 Connect     [email protected] on Test
>            131 Query       SET SQL_AUTO_IS_NULL = 0
>            131 Query       SET SESSION TRANSACTION ISOLATION LEVEL 
> REPEATABLE READ
>            131 Query       Select last_insert_id()
>              1 Query       Commit
> ...
> 
> Thanks in advance,
> Mauricio Bruns
> 
> 
> --
> MySQL ODBC Mailing List
> For list archives: http://lists.mysql.com/myodbc
> To unsubscribe:    http://lists.mysql.com/[email protected]

-- 
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.