yammer / breakerbox

Frontend for Tenacity + Archaius
Apache License 2.0
63 stars 29 forks source link

com.yammer.breakerbox.jdbi.DependencyDB#findLatest is failing on Oracle DB #47

Open maksymgendin opened 6 years ago

maksymgendin commented 6 years ago

Hi!

com.yammer.breakerbox.jdbi.DependencyDB#findLatest is failing on Oracle DB because of limit 1 in the query...I wanted to discuss possible solutions to fix it 😄 With Hibernate it would be simple, but I have no idea if there is a nice solution with JDBI except calling com.yammer.breakerbox.jdbi.DependencyDB#all (the result list is ordered via order by timestamp desc) and getting the first entry in the result list...

Best regards Maksym

maksymgendin commented 6 years ago

@chrisgray Any thoughts on it?

chrisgray commented 6 years ago

I'd suggest us rewriting the findLatest SQL query to instead of trying to leverage limit 1 or fetch first rows or using rownum. Perhaps we just rewrite the select overall to do a sub-select to find the max of the timestamps and then use that to produce similar output to the current limit 1 query. That way it doesn't have to fight against the different sql syntaxes for row limitation.

maksymgendin commented 6 years ago

@chrisgray Is my pull request O.K.?

chrisgray commented 6 years ago

@maksymgendin I'm sorry but I'm no longer a Yammer employee so I'm unable to merge your PR. We'd have to get someone from Yammer to merge this in.

maksymgendin commented 6 years ago

@clarkbreyman-yammer @bmorton @chrismohr @daniel-robertson @eoh @geoffreymoller @ipoval @jamessheridan @jaylaney @joelklabo @kevn @SirAlvarex @smoak

Hi guys! Could you please take a look at my pull request for this issue and merge it if it's O.K.? It's getting really urgent. Thanks in advance! <3