8月 082012
 

admuser.ADMIN_CONFIG.CONFIG_DATA列にBLOBデータとしてXMLファイルが格納されており、その中に記述されている。
そのため、別環境からデータをインポートする際は、dbconfigpvもしくはeppmconfigでConfigurationを新たに作成する必要がある。
正しく設定できていないと、ログイン時に「ログインに失敗しました。データベース・インスタンスが無効です。」と言われログインできず、UnknownHostException等が発生する。

IntegrationAPIを利用する場合はapi\dbconfigも実行する必要がある。

P6 EPPM Post Installation Administrator’s Guide の24ページも参照。

Note: If you are upgrading from a previous version of P6 against the
same database, choose the option to create a new configuration.
This is necessary to accommodate newly added configuration
settings.

7月 182012
 

Primavera Integration API Programmer’s Reference には

Of course, Local Mode could be called directly from JSP pages that are deployed as part of a Web Application.

という記述があるが、LocalModeでリモートDBにアクセスすると以下のようなエラーとなる。

java.lang.RuntimeException: com.primavera.bo.common.InvalidInstanceLoginException: Invalid database instance while checking authentication mode.
        at j0a1590.Main.testPrimavera(Main.java:72)
        at j0a1590.Main.main(Main.java:26)
Caused by: com.primavera.bo.common.InvalidInstanceLoginException: Invalid database instance while checking authentication mode.
        at com.primavera.bo.common.b.a(LoginHelper.java:111)
        at com.primavera.bo.remotable.SessionLifetime.login(SessionLifetime.java:57)
        at com.primavera.bo.remotable.qproxy.SessionLifetime.login(SessionLifetime.java:76)
        at com.primavera.bo.DBSessionLifetime.login(DBSessionLifetime.java:28)
        at com.primavera.integration.server.ServerFacadeBase.login(ServerFacadeBase.java:434)
        at com.primavera.integration.server.ServerFacade.login(ServerFacade.java:11)
        at com.primavera.integration.client.LocalSession.login(LocalSession.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.primavera.integration.client.Session.a(Session.java:355)
        at com.primavera.integration.client.Session.login(Session.java:343)
        at j0a1590.Main.testPrimavera(Main.java:60)
        ... 1 more

アプリケーションサーバーとDBサーバーが同じマシンの場合は可能。

マニュアル通り、以下のような変更を施せばRemoteModeに変更出来る。
ただしサーバーでRMIサービスが提供されている必要がある。
[java title=”LocalMode”]
DatabaseInstance[] dbInstances = Session.getDatabaseInstances( RMIURL.getRmiUrl( RMIURL.LOCAL_SERVICE ) );
// Assume only one database instance for now, and hardcode the username and
// password for this sample code
session = Session.login( RMIURL.getRmiUrl( RMIURL.LOCAL_SERVICE ), dbInstances[0].getDatabaseId(), “admin”, “admin” )
[/java]
[java title=”RemoteMode”]
DatabaseInstance[] dbInstances = Session.getDatabaseInstances( RMIURL.getRmiUrl( RMIURL.STANDARD_RMI_SERVICE, “localhost”, 9099 ) );
// Assume only one database instance for now, and hardcode the username and
// password for this sample code. Assume the server is local for this sample code.
session = Session.login( RMIURL.getRmiUrl( RMIURL.STANDARD_RMI_SERVICE, “localhost”, 9099 ), dbInstances[0].getDatabaseId(), “admin”, “admin” );
[/java]

サーバーは9099でListeningしているが、実際にデータ通信を行う際は新たなTCPコネクションを形成するようで、そちらのポートが62793であるが、恐らくは(同時アクセスの場合などで)クライアントによって変更される可能性があると考えられる。

ちなみにJavaRMIレジストリーの標準ポートは1099の模様。
Primaveraは9099がデフォの様子。
レジストリポートはAdministrator toolで変更可能。