transaction aspect interceptor error

I'm getting the below error when using the transaction aspect
interceptor in Coldbox 3.0 final release to save objects. I started
getting the issue when I upgraded from RC2 to final.

After a diff of rc2 and 3 files I changed the below line 46 in
transaction aspect and it resolved my issue. Please look in to it as
I'm not sure what is triggering the log variable from getting set
properly.
Line 46 :adviseBuilder(arguments.interceptData.target);
Changed to
adviseBuilder(arguments.interceptData);

Exception:
struct
Detail [empty string]
ErrNumber 0
Message Variable LOG is undefined.
StackTrace coldfusion.runtime.UndefinedVariableException: Variable
LOG is undefined. at coldfusion.runtime.CfJspPage._get(CfJspPage.java:
303) at coldfusion.runtime.CfJspPage._get(CfJspPage.java:283) at
coldfusion.runtime.CfJspPage._get(CfJspPage.java:271) at
cfTransactionAspect2ecfc950611561$func$AOP_TRANSACTION.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\orm\hibernate
\TransactionAspect.cfc:232) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cf78f052f42dea1f2d43432d90c62da461c0da7be82ecfm122310338$funcPROCESSENTRIES.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\testing\stubs\78f052f4-
ea1f-4343-90c6-a461c0da7be8.cfm:6) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cfadmin2ecfc1217908821$funcFETCHFEED.runFunction(C:\ColdFusion9\wwwroot
\aggregator\modules\rssAggregator\handlers\admin.cfc:100) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:389) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2723) at
cfController2ecfc1944470730$funcINVOKER.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\web\Controller.cfc:694) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfController2ecfc1944470730$funcRUNEVENT.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\web\Controller.cfc:579) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cfColdbox2ecfc1074052954$funcPROCESSCOLDBOXREQUEST.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\Coldbox.cfc:243) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfApplication2ecfc1001192012$funcONREQUESTSTART.runFunction(C:
\ColdFusion9\wwwroot\aggregator\Application.cfc:63) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88) at
coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:
258) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:349)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:
40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:
28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at
coldfusion.CfmServlet.service(CfmServlet.java:200) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:
89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:
42) at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
jrun.servlet.FilterChain.service(FilterChain.java:101) at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
286) at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
543) at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:
203) at jrunx.scheduler.ThreadPool
$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at
jrunx.scheduler.ThreadPool
$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at
jrunx.scheduler.ThreadPool
$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
TagContext
array
1
struct
COLUMN 0
ID ??
LINE 232
RAW_TRACE at cfTransactionAspect2ecfc950611561$func
$AOP_TRANSACTION.runFunction(C:\ColdFusion9\wwwroot\coldbox\system\orm
\hibernate\TransactionAspect.cfc:232)
TEMPLATE C:\ColdFusion9\wwwroot\coldbox\system\orm\hibernate
\TransactionAspect.cfc
TYPE CFML
2
struct
COLUMN 0
ID CF_TEMPLATEPROXY
LINE 6
RAW_TRACE at
cf78f052f42dea1f2d43432d90c62da461c0da7be82ecfm122310338$funcPROCESSENTRIES.runFunction(C:
\ColdFusion9\wwwroot\coldbox\system\testing\stubs\78f052f4-
ea1f-4343-90c6-a461c0da7be8.cfm:6)
TEMPLATE C:\ColdFusion9\wwwroot\coldbox\system\testing\stubs\78f052f4-
ea1f-4343-90c6-a461c0da7be8.cfm
TYPE CFML
Type Expression
name LOG

I cannot reproduce as an interceptor loaded in the configuration file.
How are you using this?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Oh I declared it as an interceptor in Modules and used transactional
on a service method.

I was able to reproduce this error also. Removing the .target did indeed fix it. I can commit it to my fork, but I still have a pending pull request and can only do one at a time (? seems silly, but I guess that is that case?)

Curt

How do I reproduce it? Not sure, why removing the target solves this as you need the target as that is the event thrown by wirebox.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Just create a fresh app, register the interceptor, and click on the forgebox module, you will see the error. That is the simpliest way to recreate it.

Curt

I will send in an example code when I get back home. But these are the
dependencies associated with it.

I declared an transaction interceptor in the modules.
I created a service and extended it with baseORMService.
The Service has a custom save method with transactional attribute that
saves an entity B which has a many to one relation with entity A.

Ok, I cannot reproduce this.

This is what I did.

  1. Generated new app
  2. Genereted a new module
  3. Created a new model that inherits from the base service
  4. Added a save method to it and added “transactional” to it
  5. Added an injection to my module handler to get that model object
  6. requested it and all good.

I create a new application
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Luis,
Please grab the test module from here..http://dl.dropbox.com/u/2302675/
transaction.zip

I tested the same code with RC2 release and it works fine. So I'm
really not sure if its my coding issue or I didnt understand
transaction Aspect interceptor.

Ok, I know why finally, thanks!!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Ok, fixed on dev branch.

Also, this needs to be added to make it work:

public any function customSave(entity) transactional{

save(entity=arguments.entity,transactional=false);

}

The save must be non-transactional, or the transactional aspect is useless.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

You are the man and yes It needs to be set to false as well or else
the session gets stale.

I believe the underlining issue is still there. By adding the
transactional argument to the base orm service you just fixed the
transaction error he was having (which was putting him in the catch
clause where the log is referenced), not the issue with log not being
defined.

For a quick test of this add this line to the $aop_transaction
function (don't wrap it in a conditonal):

log.info("If you see this I worked. But I bet you're looking at a log
is undefined error");

.brett

again, this is fixed on dev branch. log was not being wired.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com