Hi Suhas,
I believe we are talking about a neo deployment, correct?
I need to ask a few questions before answering your question. Why do you need to use a compute unit on each sub-account? This way it would make it very hard to maintain version compatibility across multiple sub-accounts - no to mention a waste of compute unit resources.
Why not use the multi-tenancy concept and the SCP SDK APIs to figure out on which tenant your code is running? This way you database connection will always remain bound in your main account. The sub-accounts will contain only a subscription to the main account and thus there is no need to have multiple deployments. All you need to do is figure out the tenant ID during app logon (first UI screen you display) and than you manage the database artifacts based on the tenant ID (just like SAP ERP does with the 'client' concept). There are APIs on the SDK available to determine the context on which your code is running. And there are also ways to make your code run from the main account onto the context of another sub-account (tenant). Let me know if you need any details on this approach so I can provide you links to the relevant documentation.
If the above approach doesn't work for you, please let us know how your EJB connects to your database instance (i.e: JPA, JDBC/DAO, etc.) - recommended way is to use JPA with either Spring Boot or EclipseLink. In any case, please share how your persistence.xml for us to better understand what is being used and how. I believe you may need to set property "javax.persistence.schema-generation.database.action" to "none" to avoid schema creation at startup. This way SCP will not attempt to bind your app to a database right away. But this is only a wild guess, since I am not sure how your app is set.
Regards,
Ivan
Add comment