ERROR(304): Connection Error: Cannot get a connection, pool

Keep getting the error 304 more frequently, data source faulted. What could be the main cause of this?

Sounds like your JDBC connection pool is full when you are trying to get a connection.
You can increase the connection pool size and/or increase the time to that it will wait for a new connection to become available (by editing the datasource)
… BUT…

This is almost always because you’re doing something wrong, and increasing those pooling parameters is just delaying the real fix. You’re probably running way too many queries and/or running queries that are taking way too long (because they use un-indexed columns or are retrieving too much data or something like that).

As you might imagine, trouble shooting this is pretty project-specific, but the best way is usually to go to go to the FactoryPMI gateway status page and look at the throughput on your datasources, and open the tool that comes with your database that shows the queries that are being run and see if there are queries that are taking a long time.