Forum OpenACS Q&A: Instance aware ecommerce package

Collapse
Posted by Dave McBride on
I have begun to make the ecommerce package instance aware as I need it to be for some work I am doing. I am using the 4.6 pre source for the package at this time. Getting multiple instances up and running was quick, but all instances see the same products, orders, categories, etc. Nothing is secure to the instance. Should I be using another code base or is anyone else working on this that I should coordinate with? Once working the question of instance aware payment packages would be desirable.
Collapse
Posted by Dave McBride on
I have the PostgreSQL version up and running nicely.

I am having difficulties with the Oracle version. I have run into the integrity constraint problem:
------------------------------------------------
ora8.c:3568:ora_tcl_command: error in `OCIStmtExecute ()': ORA-02291: integrity constraint (OPENACS46.ACS_OBJECTS_OBJECT_TYPE_FK) violated - parent key not found
ORA-06512: at "OPENACS46.ACS_OBJECT", line 68
ORA-06512: at "OPENACS46.EC_CATEGORY", line 17
ORA-06512: at line 3

SQL:
        begin
            :1 := ec_category.new (
        category_id => :category_id,
        category_name => :category_name,
        sort_key => :sort_key,
        last_modified => sysdate,
        last_modifying_user => :user_id,
        modified_ip_address => :creation_ip,
        creation_user => :user_id,
        creation_ip => :creation_ip,
        context_id => :package_id
                );
            end;

    while executing
"ns_ora exec_plsql_bind nsdb0 {
        begin
            :1 := ec_category.new (
        category_id => :category_id,
        category_name => :category_name,
        sort_k..."
    ("uplevel" body line 1)
-----------------------------------------------------

I seem to be able to create 1 type of object such as a template or category, then no other object.  Any suggestions?

Dave

Collapse
Posted by Dave McBride on
A solution was found.

See if there is a line in the    acs_object_type.create_type
call such as this:

package_name  => 'NAME'

For some reason, this line allows only one object type to be created for that package name.  I removed it from my calls and  the error does not occur.

Dave

Collapse
Posted by Dave Bauer on
Hmmm.

The package_name attribute of acs_objects refers to the pl/sql package of pl/sql procedures to manage objects of that type. So in oracle you would end up with packagename.new to create a new object of that type. Usually the package_name is the same as the object_type. In postgresql there are not plpgsql packages but we name the functions like so: packagename__new using two underscore characyers in place of the dot. The package_name attribute is used by some Tcl procs to manage objects such as package_instantiate_object.