Hung transactions which are completed within a transaction processing system are resolved. The transactions are replicated from a source database to a target database by a replication engine. The hung transaction is incomplete in either the source or the target database. A transaction pattern table is provided that includes a plurality of records, each record being defined by a transaction pattern identifier. Each record includes a transaction pattern and a metric of occurrence of the transaction pattern. A comparison is made of the series of one or more transaction steps or operations of a hung transaction to the transaction patterns in the transaction pattern table, and a subset of transaction patterns in the transaction pattern table are identified that are potential candidates for matching the hung transaction. The hung transaction is categorized using the metric of occurrence of the transaction pattern for each transaction pattern in the subset of transaction patterns. The categorizing predicts when all of the series of one or more transaction steps or operations which have completed in the source database have been replicated. The metric of occurrence of the transaction pattern for each record of the transaction pattern table is (i) a count that is continuously updated based on completed transactions that match the transaction pattern, or (ii) a prepopulated probability of occurrence of the transaction pattern, or (iii) derived from historical data of the transaction pattern. The hung transaction is then processed using the categorization of the hung transaction.