<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>https://dosideas.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Transacciones_Autonomas_En_Oracle</id>
		<title>Transacciones Autonomas En Oracle - Historial de revisiones</title>
		<link rel="self" type="application/atom+xml" href="https://dosideas.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Transacciones_Autonomas_En_Oracle"/>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;action=history"/>
		<updated>2026-05-09T15:09:20Z</updated>
		<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
		<generator>MediaWiki 1.28.2</generator>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6085&amp;oldid=prev</id>
		<title>194.69.224.8: /* Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it */</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6085&amp;oldid=prev"/>
				<updated>2011-08-17T08:14:16Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 08:14 17 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l163&quot; &gt;Línea 163:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 163:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Caso Real: Proyecto SIDIE&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;AIRBUS MILITARY&lt;/del&gt;. EGA 2011.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;No obstante, depende de la lógica de negocio el que se pueda crear una transacción de éste tipo, ya que en el supuesto de&amp;#160; hacer COMMIT y la trasacción principal hace ROLLBACK, no se va a deshacer lo hecho dentro del bloque autónomo, por lo que a veces puede ser interesante, o no,&amp;#160; el utilizarlas&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;En nuestro caso concreto, el trigger genera, en determinadas circunstancias (depende de la megaquery con join's), una serie de ficheros que son enviados vía FTP a otro sistema&lt;/ins&gt;. EGA 2011&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. SIDIE. Airbus Military&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>194.69.224.8</name></author>	</entry>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6084&amp;oldid=prev</id>
		<title>194.69.224.8: /* Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it */</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6084&amp;oldid=prev"/>
				<updated>2011-08-17T07:56:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 07:56 17 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l163&quot; &gt;Línea 163:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 163:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table XXXXXX is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. Caso Real: SIDIE &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;by &lt;/del&gt;AIRBUS MILITARY. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Aportación de &lt;/del&gt;EGA.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. Caso Real: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Proyecto &lt;/ins&gt;SIDIE&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. &lt;/ins&gt;AIRBUS MILITARY. EGA &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2011&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>194.69.224.8</name></author>	</entry>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6082&amp;oldid=prev</id>
		<title>194.69.224.8: /* Para evitar el ORA-04091: table string.string is mutating, trigger/function may not see it */</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6082&amp;oldid=prev"/>
				<updated>2011-08-17T07:53:08Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Para evitar el ORA-04091: table string.string is mutating, trigger/function may not see it&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 07:53 17 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l161&quot; &gt;Línea 161:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 161:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Esta utilización va al corazón del valor de las transacciones autónomas. Mientras nos movemos más a fondo en un mundo de Internet disperso y multi-capa, se vuelve fundamental la posibilidad de ofrecer unidades independientes de trabajo (también conocidas como cartridges) que realicen su tarea sin efecto sobre el ambiente que lo llama.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Esta utilización va al corazón del valor de las transacciones autónomas. Mientras nos movemos más a fondo en un mundo de Internet disperso y multi-capa, se vuelve fundamental la posibilidad de ofrecer unidades independientes de trabajo (también conocidas como cartridges) que realicen su tarea sin efecto sobre el ambiente que lo llama.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string.string &lt;/del&gt;is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Para evitar el ORA-04091: table &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;XXXXXX &lt;/ins&gt;is mutating, trigger/function may not see it===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. Caso Real: SIDIE by AIRBUS MILITARY. Aportación de EGA.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. Caso Real: SIDIE by AIRBUS MILITARY. Aportación de EGA.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>194.69.224.8</name></author>	</entry>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6081&amp;oldid=prev</id>
		<title>194.69.224.8 en 07:51 17 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=6081&amp;oldid=prev"/>
				<updated>2011-08-17T07:51:51Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 07:51 17 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l160&quot; &gt;Línea 160:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 160:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Esta utilización va al corazón del valor de las transacciones autónomas. Mientras nos movemos más a fondo en un mundo de Internet disperso y multi-capa, se vuelve fundamental la posibilidad de ofrecer unidades independientes de trabajo (también conocidas como cartridges) que realicen su tarea sin efecto sobre el ambiente que lo llama.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Esta utilización va al corazón del valor de las transacciones autónomas. Mientras nos movemos más a fondo en un mundo de Internet disperso y multi-capa, se vuelve fundamental la posibilidad de ofrecer unidades independientes de trabajo (también conocidas como cartridges) que realicen su tarea sin efecto sobre el ambiente que lo llama.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===Para evitar el ORA-04091: table string.string is mutating, trigger/function may not see it===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Cuando es inevitable hacer una consulta con múltiples JOIN's dentro de un UPDATE Trigger, y una de las tablas del Join es la misma tabla/registro que se está cambiando, Oracle muestra el ORA-04091. Si se utiliza el PRAGMA AUTONOMOUS_TRANSACTION en el bloque del Trigger, éste funciona perfectamente ya que se comporta como otra sesión diferente. Caso Real: SIDIE by AIRBUS MILITARY. Aportación de EGA.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Ver también=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Oracle]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>194.69.224.8</name></author>	</entry>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=2984&amp;oldid=prev</id>
		<title>Admin en 18:09 26 ago 2009</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=2984&amp;oldid=prev"/>
				<updated>2009-08-26T18:09:08Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 18:09 26 ago 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Línea 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Oracle]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Las transacciones autonomas son transacciones que aunque son llamadas dentro de otra transaccion, sus acciones son independientes de la transaccion principal.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Las transacciones autonomas son transacciones que aunque son llamadas dentro de otra transaccion, sus acciones son independientes de la transaccion principal.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=278&amp;oldid=prev</id>
		<title>201.251.182.130: Página nueva: Las transacciones autonomas son transacciones que aunque son llamadas dentro de otra transaccion, sus acciones son independientes de la transaccion principal.  =Autonomous_Transaction...</title>
		<link rel="alternate" type="text/html" href="https://dosideas.com/wiki/index.php?title=Transacciones_Autonomas_En_Oracle&amp;diff=278&amp;oldid=prev"/>
				<updated>2008-07-25T14:46:28Z</updated>
		
		<summary type="html">&lt;p&gt;Página nueva: Las transacciones autonomas son transacciones que aunque son llamadas dentro de otra transaccion, sus acciones son independientes de la transaccion principal.  =Autonomous_Transaction...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Las transacciones autonomas son transacciones que aunque son llamadas dentro de otra transaccion, sus acciones son independientes de la transaccion principal.&lt;br /&gt;
&lt;br /&gt;
=Autonomous_Transaction=&lt;br /&gt;
&lt;br /&gt;
Son transacciones independientes que pueden ser llamadas desde otra transacción. La transacción principal se detiene hasta que la transacción autónoma que invoca finaliza (como toda transacción con un commit o rollback). El commit o rollback de la transacción autónoma no afecta las acciones ya realizadas de la transacción principal, sino que aplica o desaplica los cambios realizados dentro de su bloque.&lt;br /&gt;
&lt;br /&gt;
Las transacciones autónomas son útiles para implementar acciones que necesitan ser realizadas en forma independiente, como por ejemplo una transacción de logging.&lt;br /&gt;
&lt;br /&gt;
==Ejemplo==&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE ge_log_procesos&lt;br /&gt;
 (   modulo        varchar2(3)  not null,&lt;br /&gt;
     aplicación    varchar2(30) not null,&lt;br /&gt;
     proceso       varchar2(30) not null,&lt;br /&gt;
     fecha         date         not null,&lt;br /&gt;
     mensaje       varchar2(100),&lt;br /&gt;
     reg_procesados  number&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 PACKAGE ejm_autonomous_transaction AS&lt;br /&gt;
     g_modulo    ge_log_procesos.modulo%TYPE := ‘EJM’;&lt;br /&gt;
     g_aplicacion   ge_log_procesos.aplicacion%TYPE := ‘EJM_AUTONOMOUS_TRANSACTION’;&lt;br /&gt;
     PROCEDURE principal;&lt;br /&gt;
 END;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 PACKAGE BODY ejm_autonomous_transaction AS&lt;br /&gt;
  PROCEDURE log_proceso(p_proceso VARCHAR2, p_mensaje VARCHAR2, p_regproc NUMBER) IS&lt;br /&gt;
     PRAGMA autonomous_transaction;&lt;br /&gt;
  BEGIN&lt;br /&gt;
     INSERT INTO ge_log_procesos&lt;br /&gt;
            (modulo, aplicacion, proceso, fecha, mensaje, reg_procesados)&lt;br /&gt;
     VALUES&lt;br /&gt;
            (g_modulo, g_aplicacion, p_proceso, sysdate, p_mensaje, p_regproc);&lt;br /&gt;
     commit;&lt;br /&gt;
  END log_proceso;&lt;br /&gt;
&lt;br /&gt;
  PROCEDURE principal IS&lt;br /&gt;
    v_cont_100   NUMBER := 0;&lt;br /&gt;
    v_cont_total NUMBER := 0;&lt;br /&gt;
  BEGIN&lt;br /&gt;
    log_proceso('Ejemplo AT','Inicio del proceso',0);&lt;br /&gt;
&lt;br /&gt;
    FOR rec IN (SELECT * FROM ALL_TABLES)&lt;br /&gt;
    LOOP&lt;br /&gt;
        IF v_cont_100 &amp;gt;= 100 THEN&lt;br /&gt;
           log_proceso('Ejemplo AT','Ejecucion proceso',v_cont_total);&lt;br /&gt;
           v_cont_100 := 0;&lt;br /&gt;
        END IF;&lt;br /&gt;
        v_cont_100   := v_cont_100   + 1;&lt;br /&gt;
        v_cont_total := v_cont_total + 1;&lt;br /&gt;
    END LOOP;&lt;br /&gt;
&lt;br /&gt;
    COMMIT;&lt;br /&gt;
&lt;br /&gt;
    log_proceso('Ejemplo AT','Fin del proceso con exito',v_cont_total);&lt;br /&gt;
&lt;br /&gt;
  EXCEPTION when others THEN&lt;br /&gt;
     Rollback;&lt;br /&gt;
     log_proceso('Ejemplo AT',&lt;br /&gt;
                 'Fin del proceso con error '||SQLERRM(SQLCODE), v_cont_total);&lt;br /&gt;
  END principal;&lt;br /&gt;
 END;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Sintaxis=&lt;br /&gt;
&lt;br /&gt;
 PRAGMA AUTONOMOUS_TRANSACTION&lt;br /&gt;
&lt;br /&gt;
La palabra pragma significa que la sentencia que continua es una directiva para el compilador, no afectando el significado del programa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Reglas y Restricciones=&lt;br /&gt;
&lt;br /&gt;
==Si se puede (debe)==&lt;br /&gt;
&lt;br /&gt;
Este pragma puede usarse en las siguientes rutinas:&lt;br /&gt;
* Un bloque pl/sql anónimo top-level (no anidado)&lt;br /&gt;
* Funciones o Procedimientos individuales o empaquetados&lt;br /&gt;
* Métodos de un tipo Objeto sql&lt;br /&gt;
* Triggers.&lt;br /&gt;
&lt;br /&gt;
El pragma se puede declarar en cualquier parte de la sección DECLARE de la rutina, pero por redibilidad, se sugiere declararlo al inicio de la sección.&lt;br /&gt;
&lt;br /&gt;
  PROCEDURE log_proceso(p_proceso VARCHAR2, p_mensaje VARCHAR2, p_regproc NUMBER) IS&lt;br /&gt;
     PRAGMA autonomous_transaction;&lt;br /&gt;
  BEGIN&lt;br /&gt;
     ….. Sentences …..&lt;br /&gt;
     commit;&lt;br /&gt;
  END log_proceso;&lt;br /&gt;
&lt;br /&gt;
A diferencia de los triggers tradicionales, los triggers “autonomous” pueden (deben) contener las sentencias COMMIT o ROLLBACK, y pueden también ejecutar sentencias DDL (como por ejemplo CREATE y DROP) usando sql dinámico.&lt;br /&gt;
&lt;br /&gt;
Todo bloque definido como autonomous transaction debe finalizar con un COMMIT o ROLLBACK explícito. De lo contrario  al programa principal le queda una transacción pendiente lo que hace que se ejecute una exception.&lt;br /&gt;
&lt;br /&gt;
  PROCEDURE log_proceso(p_proceso VARCHAR2, p_mensaje VARCHAR2, p_regproc NUMBER) IS&lt;br /&gt;
     PRAGMA autonomous_transaction;&lt;br /&gt;
  BEGIN&lt;br /&gt;
     INSERT INTO ge_log_procesos&lt;br /&gt;
            (modulo, aplicacion, proceso, fecha, mensaje, reg_procesados)&lt;br /&gt;
     VALUES&lt;br /&gt;
            (g_modulo, g_aplicacion, p_proceso, sysdate, p_mensaje, p_regproc);&lt;br /&gt;
     commit;&lt;br /&gt;
  END log_proceso;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==No se puede==&lt;br /&gt;
&lt;br /&gt;
No se puede usar el pragma para marcar todos los subprogramas en un package (o todos los métodos de un tipo objeto) como autónomos. Solo las rutinas individuales pueden ser marcadas como autónomas.&lt;br /&gt;
&lt;br /&gt;
 PACKAGE ejm_autonomous_transaction AS&lt;br /&gt;
     PRAGMA autonomous_transaction;&lt;br /&gt;
     g_modulo    ge_log_procesos.modulo%TYPE := ‘EJM’;&lt;br /&gt;
     g_aplicacion   ge_log_procesos.aplicacion%TYPE := ‘EJM_AUTONOMOUS_TRANSACTION’;&lt;br /&gt;
     PROCEDURE principal;&lt;br /&gt;
 END;&lt;br /&gt;
&lt;br /&gt;
No se puede usar el pragma en bloques de pl/sql anidados.&lt;br /&gt;
&lt;br /&gt;
 PROCEDURE og_proceso(p_proceso VARCHAR2, p_mensaje VARCHAR2, p_regproc NUMBER) IS&lt;br /&gt;
  BEGIN&lt;br /&gt;
     DECLARE&lt;br /&gt;
        PRAGMA autonomous_transaction;&lt;br /&gt;
     BEGIN&lt;br /&gt;
        INSERT INTO ge_log_procesos&lt;br /&gt;
          (modulo, aplicacion, proceso, fecha, mensaje, reg_procesados)&lt;br /&gt;
        VALUES&lt;br /&gt;
          (g_modulo, g_aplicacion, p_proceso, sysdate, p_mensaje, p_regproc);&lt;br /&gt;
     END;&lt;br /&gt;
     commit;&lt;br /&gt;
  END log_proceso;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Casos prácticos de uso=&lt;br /&gt;
&lt;br /&gt;
¿En que casos podría resultar útil la utilización de transacciones autónomas ?&lt;br /&gt;
&lt;br /&gt;
Primero, reforcemos el principio general: deberíamos definir un bloque pl/sql como transacción autónoma siempre y cuando deseemos aislar los cambios realizados en ese bloque, del contexto de la transacción llamadora (principal).&lt;br /&gt;
&lt;br /&gt;
Habiendo reforzado esta idea, aquí van algunas ideas prácticas:&lt;br /&gt;
&lt;br /&gt;
===Mecanismo de Logging (ejemplo dado en este documento)===&lt;br /&gt;
&lt;br /&gt;
En el caso de hacer log de errores à usted necesita loguear un error en la tabla de log de la base, pero por otro lado necesitamos hacer rollback de la transacción principal por el error generado. Usando Autonomous Transaction, nos quedaría el error en la tabla de log, pero las acciones de la transacción principal volverían atrás.&lt;br /&gt;
&lt;br /&gt;
En el caso de hacer log de seguimiento à desde otra sesión podemos ir controlando el avance del proceso (ya que al usar una transacción autónoma para insertar en la tabla de logs, se va haciendo commit del insert y se hace visible para el resto de las sesiones).&lt;br /&gt;
&lt;br /&gt;
===Contador de Intentos===&lt;br /&gt;
&lt;br /&gt;
Supongamos que se desea dejar que un usuario intente acceder a un recurso N veces antes de rechazarlo. Esta persistencia podría requerir un COMMIT, pero podríamos mantenerla independiente de la transacción.&lt;br /&gt;
&lt;br /&gt;
===Medidor de uso del software===&lt;br /&gt;
&lt;br /&gt;
Podemos querer registrar la frecuencia con que un programa es llamado durante la sesión de una aplicación. Esta información no debería estar asociada a la transacción que llama el programa, ya que independientemente que la transacción realice commit o rollback, igualmente podríamos desear registrar la llamada.&lt;br /&gt;
&lt;br /&gt;
===Componentes reusables===&lt;br /&gt;
&lt;br /&gt;
Esta utilización va al corazón del valor de las transacciones autónomas. Mientras nos movemos más a fondo en un mundo de Internet disperso y multi-capa, se vuelve fundamental la posibilidad de ofrecer unidades independientes de trabajo (también conocidas como cartridges) que realicen su tarea sin efecto sobre el ambiente que lo llama.&lt;br /&gt;
&lt;br /&gt;
=Ver también=&lt;br /&gt;
* [[Oracle]]&lt;/div&gt;</summary>
		<author><name>201.251.182.130</name></author>	</entry>

	</feed>