tracker issue : CF-3149408

select a category, or use search below
(searches all categories and all time range)

Re-Opening bug #3138032 - this is not a 3rd Party problem

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Andrew Scott / Andrew Scott (Andrew Scott)

Created: 03/26/2012

Components: ORM Support

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Public Beta /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Windows 7

Vote Count: 1

Duplicate ID:	CF-3138032

Problem Description:

As per the notes by Rupesh this is not a problem with a 3rd Party, Grails has been able to do this for 6 years and Java is very capable of also doing this, by creating a new session and saving it.

ColdFusion can't so this is a problem with ColdFusion and the way Hibernate has been implemented.

Please see for further problems that opening a session that one can do in Java.

In other words in Java I can write something like this

        Session session = sessionFactory.openSession();

        Message message = new Message();

In an Event Handler and it will work, ColdFusion it will not work and is a bug. Please don't dismiss this as a bug when we can;t even do other workarounds like opening / creating a session all which are very valid in Java, but not with ColdFusion.

I wanted to try this again and get you to understand how important this error is.

Currently I am trying to find a way to write audit logs for my entities, and have been trying to find a way for this using entities for now 4 years.

I will give you the basic code, but rest assured that this is also being checked to see if that entity has called the event if so then don't run the code. But for now I just want to give you a basic concept of the problem.

So lets say we have an event handler.

public void function postInsert(any entity) {
var domain = new domains.audit(auditDateTime: now(), template: #getMetaData( entity ).fullname#, detail: 'This is a test of strength', ipAddress: cgi.http_host);

Now remember that this is an example, the actual code will check to see if the even being run is the audit so we don't end up in some serious loop.

As it stands now there is no way to be able to do this, and it will throw a session closed error. All the standard Java techniques don't seem to work because there is no way to open a new session for that entity to be created and saved.

This is also a major issue that as annoyed me for 4 years and I am at a loss, a big loss as how to implement something like this. When you code for anyone who has ISO certifications this is a must that audit logs take place on data that has changed.

So I am in need of a solution here, but I am not sure the client will even pay for an upgrade to ColdFusion 10. So I may just have to go and right this in Grails where I am able to achieve this with no issues.

Steps to Reproduce:

Actual Result:

Expected Result:

Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3149408

External Customer Info:
External Company:  
External Customer Name: ascott67
External Customer Email:  
External Test Config: My Hardware and Environment details:



Maybe ColdFusion could include and utilise this instead
Comment by External U.
19891 | March 26, 2012 06:23:09 AM GMT
Seriously, why do you keep closing this as duplicate. The problem is not a 3rd party issue, you haven't re-opened the original ticket. Why is it that every other language is very capable of using auditing in this manner, except ColdFusion. Grails does it very well, there are hundreds of examples for Java and yet ColdFusion is pinned as a problem with 3rd Party. No wonder so many developers are getting pissed of with ColdFusion and moving on.
Comment by External U.
19892 | April 02, 2012 08:06:57 AM GMT
We want to use Hibernate Envers and cannot will this ever e fixed?
Vote by George M.
19893 | March 09, 2017 09:34:25 AM GMT