Application Development Notes: Tips and Tricks

LC_ALL

Exception = javax.resource.spi.ResourceAllocationException
Source = com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection
probeid = 299
Stack Dump = javax.resource.spi.ResourceAllocationExceptionDSRA8100E: Unable to get a XAConnection from the DataSource. with SQL State : XJ041 SQL Code : 40000
    at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1578)

LC_ALL is the way to fix.

Before executing the Java application.

export LC_ALL=en_US.UTF-8

https://stackoverflow.com/a/9894836/1873438
http://db.apache.org/derby/docs/10.5/tools/ctools1004764.html#ctools1004764__rtoolsijtools91283
https://stackoverflow.com/questions/55673886/what-is-the-difference-between-c-utf-8-and-en-us-utf-8-locales

Multi-module Javadocs where Search doesn’t resolve the context properly

<additionalJOption>--no-module-directories</additionalJOption>
or
<additionalOption>--no-module-directories</additionalOption>

Search will generate which avoid the <undefined>, and use the root folder.

https://stackoverflow.com/questions/52326318/maven-javadoc-search-redirects-to-undefined-url

Gatsby with the Carbon Theme

The IBM project I work on uses Carbon Theme with Gatsby to generate our HTML pages. The Carbon Design system has a nice git repository at GIT: gatsby-theme-carbon. I recommend cloning these repository.  The repository has an example and a place to figure out where and how to Shadow a feature – “provide their own components for the theme to use over the defaults”.

A couple of plugins I recommend are:
gatsby-plugin-slug – https://www.gatsbyjs.org/packages/gatsby-plugin-slug/ resolves inter-page links
gatsby-plugin-manifesthttps://www.gatsbyjs.org/packages/gatsby-plugin-manifest/?=gatsby-plugin-manifest favicon, general theme details, metadata, supports mdx and md formatted files.
gatsby-plugin-sitemap – https://www.gatsbyjs.org/packages/gatsby-plugin-sitemap/ makes the site searchable

To update the components, use

– Navigation (on left) – Update the src/data/nav-items.yaml
– Footer – Update the src/gatsby-theme-carbon/components/Footer.js Only one column and content area used. (RIGHT column not used)
– Header – The custom header src/gatsby-theme-carbon/components/Header.js is in this file. This is the only one that should be edited.  The other files are theme.

To see team’s configuration, you can view https://github.com/IBM/FHIR/tree/master/docs

Building a Carbon Site
0 – clone git: IBM/FHIR and change to /docs
1 – npm install
– if prompted, install these plugins:
npm install –save gatsby-plugin-manifest
npm install –save gatsby-plugin-slug
npm install –save gatsby-plugin-manifest
2 – gatsby build –prefix-paths
The build should output:
08:02:18-pb@pauls-mbp:~/git/wffh/oct27/FHIR/docs$ gatsby build –prefix-paths
success open and validate gatsby-configs – 0.090 s
success load plugins – 1.701 s
success onPreInit – 0.017 s
success delete html and css files from previous builds – 0.019 s
success initialize cache – 0.031 s
success copy gatsby files – 0.080 s
success onPreBootstrap – 1.931 s
success source and transform nodes – 4.337 s
success building schema – 0.272 s
success createPages – 0.014 s
success createPagesStatefully – 1.165 s
success onPreExtractQueries – 0.014 s
success update schema – 0.071 s
success extract queries from components – 0.243 s
success write out requires – 0.017 s
success write out redirect data – 0.015 s
success Build manifest and related icons – 0.110 s
success Build manifest and related icons – 0.129 s
success onPostBootstrap – 0.268 s

info bootstrap finished – 15.674 s

success run static queries – 0.049 s — 6/6 187.18 queries/second
success Building production JavaScript and CSS bundles – 105.557 s
success Rewriting compilation hashes – 0.029 s
success run page queries – 0.087 s — 19/19 312.56 queries/second
success Building static HTML for pages – 21.400 s — 19/19 14.81 pages/second
info Done building in 142.923 sec

3 – gatsby serve (to check)
4 – on a different repo, copy the files from `public/` over to the gh-pages branch at the root
5 – git add .
6 – git push

I hope this helps you with Carbon/Gatsby.

Additional Links
Gatsby Theme: Carbon https://github.com/carbon-design-system/gatsby-theme-carbon
Gatsby Theme Carbon: Guides https://gatsby-theme-carbon.now.sh/guides/
Carbon Design https://www.carbondesignsystem.com/components/link/code/
Carbon Theme Details http://react.carbondesignsystem.com/?path=/story/link–default
MDX https://mdxjs.com/

IBM Db2 with IBM FHIR Server – FHIR Schema

My colleague Albert has also merged a Dockerfile for testing, it’s a good place to start.


docker run -itd –name fhirdby –privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=password -e DBNAME=fhirdb -v database:/database ibmcom/db2


docker exec -ti fhirdby bash -c “su – db2inst1”
source .bashrc

# Recreate the DB with the right page size the tablespace is implictly created by the tool
[db2inst1@c58991a6a1a2 ~]$ db2 terminate
DB20000I The TERMINATE command completed successfully.
[db2inst1@c58991a6a1a2 ~]$ db2 drop db fhirdb
DB20000I The DROP DATABASE command completed successfully.
[db2inst1@c58991a6a1a2 ~]$ db2 CREATE DB FHIRDB using codeset UTF-8 territory us PAGESIZE 32768
DB20000I The CREATE DATABASE command completed successfully.

# Create the schemas
[db2inst1@c58991a6a1a2 ~]$ db2 connect to fhirdb
Database Connection Information
Database server = DB2/LINUXX8664 11.5.0.0
SQL authorization ID = DB2INST1
Local database alias = FHIRDB

[db2inst1@c58991a6a1a2 ~]$ db2 “create schema fhirdata”
DB20000I The SQL command completed successfully.
[db2inst1@c58991a6a1a2 ~]$ db2 “create schema fhir_admin”
DB20000I The SQL command completed successfully.

# Run the Schema creation with a small pool
–prop-file /Users/paulbastide/git/wffh/FHIR/fhir-persistence-schema/db.properties
–schema-name FHIRDATA
–pool-size 2
–update-schema

# Create a new tenant
–prop-file /Users/paulbastide/git/wffh/FHIR/fhir-persistence-schema/db.properties
–schema-name FHIRDATA
–allocate-tenant TNT1

Contents of db.properties are
db.host=localhost
db.port=50000
db.database=fhirdb
user=db2inst1
password=change-me
sslConnection=false

Good luck with Docker/IBM FHIR Server

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.