Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7549341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:55:43+00:00 2026-05-30T09:55:43+00:00

I just ran into a strange error: could not initialize a collection: [webServiceAction.aAssignedApplication#7] which

  • 0

I just ran into a strange error:

could not initialize a collection: [webServiceAction.aAssignedApplication#7]

which makes more sense after looking at the root cause:

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'sName'

Basically, Hibernate tries to find the sort column inside the link table instead of the one table behind the referenced entity. Not sure how to tell Hibernate the correct location.

There are two entities (webServiceAction.cfc and app.cfc) linked through a table in a many-to-many relationship. Both implement a HasName.cfc interface among other interfaces..

.

Section from webServiceAction.cfc:

<cfproperty name="aAssignedApplication" 
    fieldtype="many-to-many"  
    CFC="model.app" 
    linktable="G_TRelWebserviceActionAssignment" 
    fKColumn="fkWebserviceActionID" 
    inversejoincolumn="fkApplicationID" 
    lazy="true" 
    cascade="delete-orphan"  
    orderby="sName">

.

SQL captured through a profiler listening to the MS SQL database:

select aassigneda0_.fkWebserviceActionID as fkWebser2_5_1_, 
   aassigneda0_.fkApplicationID      as fkApplic1_1_, 
   app1_.pkApplicationID             as pkApplic1_0_0_, 
   app1_.sName                       as sName0_0_, 
   app1_.sUUID                       as sUUID0_0_, 
   app1_.sToken                      as sToken0_0_, 
   app1_.sDescription                as sDescrip5_0_0_, 
   app1_.dCreateDate                 as dCreateD6_0_0_ 
from G_TRelWebserviceActionAssignment aassigneda0_ 
inner join G_TApplication             app1_ on aassigneda0_.fkApplicationID=app1_.pkApplicationID 
where aassigneda0_.fkWebserviceActionID=? 
order by aassigneda0_.sName

As you can see from the last line in the SQL block, Hibernate ends up trying to find the name column in the link table instead of the actual table behind the app.cfc objects.

I’ve already tried a more specific notation by prepending it with the entity and table names, but those attempts didn’t work out either.

Thanks in advance for any attempts to point me in the right direction.
I’d probably be able to fix it using a formula or by writing the XML file myself, but I’d like to avoid that, if possible.

Addendum:
My cascade settings were too aggressive and cascade="save-update" is enough for this task, but the main problem still exists.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:55:44+00:00Added an answer on May 30, 2026 at 9:55 am

    this is expected behavior in hibernate if you set the order by in the set definition. there is also an orderby in the manytomanydefinition which does what you want, but i do not know how to state this in coldfusion

    <bag table="linktable" order-by="column in linktable">
      <key column="idcol" />
      <many-to-many order-by="column in other table">
        <column name="" />
      </many-to-many>
    </bag>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started with opengl but I ran into some strange behaviour. Below I
I just ran into the user-defined conversions to or from an interface are not
I just upgraded to XCode 4.0.2 and ran into a strange issue. Every time
I just ran into something weird. I have two JSON arrays which holds different
Just ran into an issue with a has_many :through association and after/before-destroy callbacks not
I just ran into the weirdest of bugs today. I'm not sure if it's
I just ran into an awkward issue that has an easy fix, but not
I just ran into a piece of code that not only compiles, but gives
I just ran into an issue with Python's imaplib and Gmail's authentication mechanism: >>>
I just ran into some code that overuse semicolons, or use semicolon for different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.