[Coldbox 3.8.1] using multiple datasources for one entity

Hey everyone I'm pretty new to CB and I've been reading through the documentation and group questions and for the life of me I can't figure out how to get this to work. I have a entity that I would like to use on this new project I'm working on but it keeps inheriting whatever data source is set in the application even when I tell it to use another.

Entity code:

Component accessor=true, persistent=true table="user" entityname="user" extends="model.BaseActiveEntity"{ ... }

Virtual entity:
Component singleton=true accessory=true extends="coldbox.system.orm.hibernate.VirtualEntityService"{

Public currentUsers function init(){

Super.init(arguments=arguments, entityName="user", datasource="ds2");

Return this;



Even though I'm telling it to use DS2 it's still inheriting DS1 from the application and passing back that data instead, any help would be appreciated


You can just specify the datasource in the component attributes, as with all of the arguments you are passing in your init() overload.

Thanks for the quick reply, when I put it in the component attributes it is still defaulting to the data source set in the application.cfc. Would it have anything to do with the fact I'm using the same base entity in this module with the application datasources?