No Clean Feed - Stop Internet Censorship in Australia

Oracle Error: "Data got commited in another/same session, cannot update row."

Oracle SQL DeveloperI'm using the Oracle SQL Developer application.

Version 2.1.0.63
Build MAIN-63.73

Via the application's grid view I am trying to paste a value into a field for a single record. Field type: VARCHAR2(4000 CHAR), although I've heard this problem can also happen with CLOB/BLOB type fields.

I paste, then hit the "commit" button at the top of the grid interface. Immediately I get the following error:

"Data got committed in another/same session, cannot update row."

I say, "huh?!" ... then proceed to try it again a few times mindlessly ignoring the fact that obviously something is wrong.

Google ended up being my saviour once again when I found: http://goo.gl/2vOL in the Oracle Forums.

The following is the solution that I gleaned from the forum link above (originally posted by 'gconley'):

  1. Copy and edit the value to a safe place such as notepad or another sql developer worksheet, don't try to save in the table.
  2. In a sql developer worksheet, make an update query to set the BLOB/CLOB field to NULL
  3. Run the update query and commit
  4. Refresh your table view, the BLOB/CLOB should be NULL now
  5. Copy the value back in and commit
That fixed it... Well, it's obviously a bug in the application so it's a temporary fix/workaround at least.

 

Subscribe

cfajaxproxy exposing CFC path in page source

[Edit: The following post has been edited/re-worded in an attempt to clear up it's meaning]

I've been playing around with ColdFusion's cfaxajproxy and loving it. I was interested however to find that when the page is rendered in the browser, cfajaxproxy outputs (in the source code) the full path [Edit: literal relative path] to the CFC I'm having it call.

Example:

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/x/y/z/Expertise.cfc','expertiseCFC');

I tried using a Mapping in the CF Admin to the directory (under my webroot) containing my CFCs but still the full path [Edit: literal relative path] from root to my CFC is exposed.

Example:
Mapping made in CF Admin
"/mapping" -> "c:/.../x/y/z/"

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/x/y/z/Expertise.cfc','expertiseCFC');

When I created a Mapping to a folder *above* the webroot containing my CFC the source output changed to include the mapping reference (this is the behaviour/output I wanted, just without having to have the folder containing the CFC above the webroot).

Example:
Mapping made in CF Admin
"/mapping" -> "c:/.../{folder above web root}/"

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/mapping/Expertise.cfc','expertiseCFC');

Why is it that (using the CF Admin mapped path) when the CFC folder is above the webroot cfaxajproxy outputs the shorter mapped reference to the Javascript source code but when the CFC folder is under the webroot the full relative path from the webroot to the CFC is exposed in the Javascript source code? Is there a way around this so that the mapping is always output (I need my CFCs within the webroot, not above)?

[Edit: Additional Info]

This is how I am calling cfajaxproxy:

<cfajaxproxy
cfc = "mapping.Expertise"
jsclassname = "expertiseCFC" />

Where "mapping" is the virtual Mapping reference set within CF Admin.

Subscribe

Javascript line break rendering confusion

This is something that I know I will forget each time I run into it, so it's going up here for reference!

I use Javascript a fair bit, not as an advanced user but for everyday things like validation and moderate UI dynamic modifications. I was recently returning a string value from a remote ColdFusion function directly to a Javascript callback function then displaying it via alert() to the user. The string I returned contained "\n" characters in it so that I could control where the line breaks were to be when the alert function displayed it in a pop-up. What I wasn't counting on was that javascript would ignore these line breaks and simply display the "\n" string along with the rest of the message in one clump of characters all on a single line!

I figure, and please correct me if I am wrong, that since the string was created by ColdFusion as just that, a string, Javascript is not recognising the line breaks. If however, I was to create the exact same string in Javascript containing the same "\n" characters, it would indeed render correctly placing the line breaks where they have been indicated. Javascript seems to escape the \n values in the string passed by ColdFusion (like so: "\\n") and therefore negates the line break values.

Example:

ColdFusion returns the string: "Line one\nLine two\nLine three" and I would expect this to appear in an alert popup box as:

Line one
Line two
Line three

However the Javascript alert instead displays it as:

Line one\nLine two\nLine three

To fix this I had to use a Javascript global replace fucntion on the escaped characters in the string:

var newString = returnedString.replace(/\\n/g, '\n'); alert(newString);

Note that you have to use the "g" value in the above replace line. It stands for global - this way you replace all instances in the string and not just the first.

And that's that.

 

Subscribe