1. Bryant Burnard
  2. PowerServer 2020 or older (Obsolete)
  3. Monday, 22 July 2019 14:42 PM UTC

Hi All;

I will be setting up an Appeon Multi tenant application where our application with be a Saas. We are using PB 2017 R3 Build 1858 (and AEM of same version), Oracle 12g to provide this service.

Is there a guild line on how to allow multi db connections in Oracle, as the of_editdatasource is not supported in Oracle? Also, is there a time line when support of_editdatasource in Oracle will be?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 22 July 2019 18:52 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Bryant;

   The PowerServer "Dynamic DataSource" feature is the "cats meow" for this type of multi-tenant application design. Have a look at the "appeondconfigdatasource" object and in particular the "of_adddatasource" method. This would allow each tenant to use the same application code but connect to a unique DB instance per client.

   Unfortunately, the "Dynamic DataSource" feature is not supported for Oracle. You will need to create a DB "DataSource" for each tenant manually in AEM.

Regards ... Chris

  

Comment
  1. Chris Pollach @Appeon
  2. Monday, 22 July 2019 19:13 PM UTC
Do you mean "CacheName"?
  1. Helpful
  1. Bryant Burnard
  2. Monday, 22 July 2019 22:49 PM UTC
Err, yes I meant CacheName
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 23 July 2019 13:48 PM UTC
Yes, that feature would do the trick (as Zhao Kai has outlined). :-)
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 22 July 2019 15:56 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi Bryant

If I have understood what you want, you would like to connect to a different DB depending on some configuration?

I'm not sure what you are referring to with "of_editdatasource", that must be a function in your own code. PB functions do not have the OF_ prefix.

"Is there a guild line on how to allow multi db connections in Oracle", are you wanting to connect to one database at a time or multiple databases concurrently?

If you are connecting to one DB as once, you have a choice. You can change the transaction objects connection information to specify the SID in the tnsnames.ora. OR you can connect to a SID "saasdb" and edit the tnsnames.ora to have the correct database details. You could always edit the tnsnames.ora with you application as it is only a text file.

If you want to connect to multiple dbs concurrently then you will need to create a transaction object for each connection and then all the options above still apply.

If none of this matches your issue then please give some more details about your database setup.

 

Thanks

David

Comment
  1. Bryant Burnard
  2. Monday, 22 July 2019 17:08 PM UTC
Hi David;

the method I'm talking of is in the Appeon Work Around pbl:



https://www.appeon.com/support/documents/appeon_online_help/2017/workarounds_and_api_guide/ch01s03s10.html



We figure the db connect out, via Appeon documentation:



https://www.appeon.com/support/documents/appeon_online_help/2.0/server_configuration_guide_for_j2ee/ch03s04s01.html



where the db name is set via the cache name within the SQLCA settings.



I was wondering more on any guidelines on which settings work best for Oracle.
  1. Helpful
  1. David Peace (Powersoft)
  2. Tuesday, 23 July 2019 07:56 AM UTC
Sorry I misupderstood.
  1. Helpful
  1. Bryant Burnard
  2. Tuesday, 23 July 2019 13:32 PM UTC
Yup, no worries David.
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 23 July 2019 01:07 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi Bryant,

The appeondconfigdatasource does not support Oracle database, there is no plan to support it currently.

PowerServer supports Dynamic transaction object to data source mapping, you can create multiple data sources to connect different database. Please refer to the following steps:

1. Add data source pointing to different database in AEM;

2. Follow below online help documentation to setup transaction object to data source mapping using dynamic transaction in Appeon Web Application rather than doing it in AEM.

https://www.appeon.com/support/documents/appeon_online_help/2017/server_configuration_guide_for_net/Dynamic_transaction_object_to_connection_cache_mapping.html


You can modify code like SQLCA.DBParm="CacheName='ASADataSource1'" to connect different data sources.

ASADataSource1 is a name of data source.


For example(please note the DBMS of Oracle  12 is O10):

 

SQLCA.DBMS = "O10"

SQLCA.AutoCommit = False

 

Choose Case db_name

Case 'PROD'

SQLCA.DBParm="CacheName='appeonsample'"

Case 'DEV'

SQLCA.DBParm="CacheName='appeonsample2'"

End Choose

 

And you can enable the Dynamic Database Connection option in AEM> Server> Resources> Data Source>[data source name] and specify the user name and password to connect to the database. More details please refer to the Appeon Help > Appeon Server Configuration Guide for .NET> AEM User Guide> Server> Resources> Data Source> Adding a data source section or the online help at:

http://www.appeon.com/support/documents/appeon_online_help/2015/server_configuration_guide_for_net/ch04s03s03.html#Adding_connection_cache

 

Then you can use the script like below to specify the user/password to connect to the database.

SQLCA.LogId = %your id%

SQLCA.LogPass=%your pass%


Just for your reference, when the Dynamic Database Connection feature is turned on the LogID and LogPass of the Transaction object will be used to connect to the database; when it is turned off then the user name and password specified in the data source will be used to connect to the database.

 

Regards,
ZhaoKai

Attachments (1)
Comment
  1. Bryant Burnard
  2. Tuesday, 23 July 2019 13:32 PM UTC
Thanks ZhaoKai.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.