jpa - configure an eclipselink non-JTA sequence connection pool without jndi or persistance.xml - Stack Overflow

I am trying to find way to set eclipselink sequence pool datasource programmatically and not using JNDI

I am trying to find way to set eclipselink sequence pool datasource programmatically and not using JNDI (spring application deployed on cloud foundry). i need to set datasource explicitly as creation of datasource needs certificate authentication to postgres (on GCP)etc.

can we set DataSource to property 'eclipselink.jdbc.sequence-connection-pool.non-jta-data-source' instead of jndi name?

   LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
        factory.setPersistenceUnitName("int_portal");
        factory.setJpaVendorAdapter(jpaVendorAdapter);
        factory.setJpaDialect(new EclipseLinkJpaDialect());

        factory.setDataSource(dataSource);
        factory.setLoadTimeWeaver(loadTimeWeaver);
        factory.setJtaDataSource(dataSource);

        // PersistenceUnitProperties.CONNECTION_POOL_SEQUENCE;
        Map<String, Object> propMap = factory.getJpaPropertyMap();

        propMap.put("eclipselink.weaving", "false");
        propMap.put(PersistenceUnitProperties.SESSION_CUSTOMIZER, IPSessionCustomizer.class.getName());
        *propMap.put("eclipselink.jdbc.sequence-connection-pool", "true");
        propMap.put("eclipselink.jdbc.sequence-connection-pool.non-jta-data-source", "java:/comp/env/jdbc/intDB");

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745589723a4634758.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信