[Bioc-devel] Error during wrapup, what does this mean?

Robert Gentleman rgentlem at fhcrc.org
Fri May 20 16:32:09 CEST 2005


James W. MacDonald wrote:
> Dipl.-Ing. Johannes Rainer wrote:
> 
>> hi, it's again me, but i found the problem...
>> as i am working with database connections and if an error occurs in a 
>> function call i want to roll back the whole stuff that has been 
>> written into a database, i thought to be smart and defined with
>>
>>> options(error=expression(.rollItBack(Con)))
>>
>>
>>
>> where .rollItBack is a function that sends the command ROLLBACK 
>> TRANSACTION to the database. well, i did not think, that when the 
>> error occurs the object Con, which is a local variable in the function 
>> does not exist, unless the user has called the connection object also 
>> 'Con'.
>>
>> now i want to ask how i can define a global variable from within a 
>> function.
> 
> 
> See ?"<<-" and ?assign
> 
> HTH,
> 
> Jim
> 

Hi,

   But it is generally not a good idea to do it that way. If users have 
connections that you are using then they should be parameters to the 
functions that you are using and using try, or tryCatch, will generally 
be much better. I would also like to point out that if I understand 
this, then any error the user makes will roll-back a transaction - 
typing the wrong name for a function etc. That is probably not a good 
design decision.

   Robert



> 
>>
>> cheers, jo
>>
>> Quoting "Dipl.-Ing. Johannes Rainer" <johannes.rainer at tugraz.at>:
>>
>>> hi,
>>> i am getting the error message:
>>>
>>>> Error during wrapup: Object "Con" not found
>>>
>>>
>>>
>>> in my functions and have no idea from where this message comes (i 
>>> have renamed some function arguments from 'Con' to 'con', maybe the 
>>> message comes from there :) ). nevertheless i do not know where i 
>>> should search for this error (as the functions work like they 
>>> should...). can anybody tell me more to this error message?
>>>
>>> cheers, jo
>>>
>>> _______________________________________________
>>> Bioc-devel at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>
>>
>> _______________________________________________
>> Bioc-devel at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
> 
> 
>



More information about the Bioc-devel mailing list