Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 3, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 3, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 3, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 3, 2025

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 2025

      These solid-state fans will revolutionize cooling in our PCs and laptops

      June 3, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025
      Recent

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025

      A Comprehensive Guide to Azure Firewall

      June 3, 2025

      Test Job Failures Precisely with Laravel’s assertFailedWith Method

      June 3, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025
      Recent

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Crossly Joined

    CodeSOD: Crossly Joined

    January 9, 2025

    Antonio‘s team hired some very expensive contractors and consultants to help them build a Java based application. These contractors were very demure, very mindful, about how using ORMs could kill performance.

    So they implemented a tool that would let them know any time the Hibernate query generator attempted to perform a cross join.

    public class DB2390Dialect extends org.hibernate.dialect.DB2390Dialect
    {
     private Logger logger = LoggerFactory.getLogger(DB2390Dialect.class);
    
     @Override
     public String getCrossJoinSeparator()
     {
      try
      {
       Exception e = new Exception();
       throw e;
      }
      catch (Exception xe)
      {
       logger.warn("cross join ", xe.getMessage());
      }
      return ", ";
     }
    }
    

    I’m going to call this one a near miss. I understand what they were trying to do.

    Hibernate uses a set of “dialect”s to convert logical operations in a query to literal syntax- as you can see here, this function turns a cross join operation into a “, “.

    What they wanted to do was detect where in the code this happened and log a message. They wanted the message to contain a stack trace, and that’s why they threw an exception. Unfortunately, they logged, not the stack trace, but the message- a message which they’re not actually setting. Thus, the logger would only ever log “cross join “, but with no information to track down when or why it happened.

    That said, the standard way in Java of getting the stack trace skips the exception throwing: StackTraceElement[] st = new Throwable().getStackTrace(). Of course, that would have made them do some actual logging logic, and not just “I dunno, drop the message in the output?”

    The only remaining question is how much did this feature cost? Since these were “expert consultants”, we can ballpark it as somewhere between “a few thousand dollars” to “many thousands of dollars”..

    [Advertisement]
    ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Article10 Best Free and Open Source Command-Line HTTP Clients
    Next Article lsv – Vlang implementation of ls

    Related Posts

    News & Updates

    All the WWE 2K25 locker codes that are currently active

    June 3, 2025
    News & Updates

    PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

    June 3, 2025
    Leave A Reply Cancel Reply

    Hostinger

    Continue Reading

    CVE-2025-37782 – Linux HFS slub Out-of-Bounds Write

    Common Vulnerabilities and Exposures (CVEs)

    Git on Linux: A Beginner’s Guide to Version Control and Project Management

    Learning Resources

    CodeSOD: Allowed Savings

    News & Updates

    How to run dozens of AI models on your Mac or PC – no third-party cloud needed

    Development

    Highlights

    Development

    BlackByte Ransomware Exploits VMware ESXi Flaw in Latest Attack Wave

    August 29, 2024

    The threat actors behind the BlackByte ransomware group have been observed likely exploiting a recently…

    Why the TikTok ban could collapse the creator economy

    December 28, 2024

    Cerebras Introduces the World’s Fastest AI Inference for Generative AI: Redefining Speed, Accuracy, and Efficiency for Next-Generation AI Applications Across Multiple Industries

    August 30, 2024

    Monster Hunter Wilds will see one of the ‘rockiest’ wyverns make an explosive comeback from the series’ earlier titles

    January 17, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.