This content has been marked as final.
Show 4 replies
-
1. Re: How to subclass JDBCCacheLoader
manik Apr 1, 2009 6:32 AM (in response to jorgemoralespou_2)A reasonable request. Something for us to think about moving fwd.
-
2. Re: How to subclass JDBCCacheLoader
jorgemoralespou_2 Apr 1, 2009 12:20 PM (in response to jorgemoralespou_2)I created a JIRA:
https://jira.jboss.org/jira/browse/JBCACHE-1501 -
3. Re: How to subclass JDBCCacheLoader
genman Apr 6, 2009 3:35 PM (in response to jorgemoralespou_2)One thing that came to mind was to add a general configuration set that would allow Node key values to be mapped into specific table columns. (Sort of a poor man's JPA.) Data would be therefore stored in a way that was easily accessible and managed by your DBA.
But really the only practical use I considered would be for managing timestamps of data.
But instead of writing code, one thing you could consider is simply adding a update timestamp column to the cache loader's table, which is populated through a trigger. Then a background process run by your DBA could cull the data as necessary. -
4. Re: How to subclass JDBCCacheLoader
jorgemoralespou_2 Apr 7, 2009 4:53 AM (in response to jorgemoralespou_2)"genman" wrote:
But instead of writing code, one thing you could consider is simply adding a update timestamp column to the cache loader's table, which is populated through a trigger. Then a background process run by your DBA could cull the data as necessary.
With the fixes Manick have done, now I can subclass JDBCCacheloader, and introduced a timestamp in:TimestampedJDBCCacheLoader.populatePreparedStatementForInsertTimestampedJDBCCacheLoader.updateNode
and also:TimestampedJDBCCacheLoaderConfig.constructCreateTableDDLTimestampedJDBCCacheLoaderConfig.constructUpdateNodeSqlTimestampedJDBCCacheLoaderConfig.constructInsertNodeSql
This modifications add a timestamp column, and set timestamp value in every insert/update in the database and no need to cal the DBA guy to insert a trigger.
We are developing a product, we are a group of 5 developers, with different databases (mysql, oracle) as target for our application, so this solution seems easier for us. No need to know on target database peculiarities.
Probably to do a more complex mapping as you suggest, needs more programming on the JDBCCacheLoader subclass, but sometimes can be useful, as per when the client you deploy the app in, wants, no matter how, to have the dba guy tunning the DB, and wanting to know what goes into the DB. You know they aren`t very eager to rely on blobs.