Skip to content

Commit

Permalink
VisitorbookCache fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Dec 18, 2024
1 parent 0e69d3e commit 2c9ea00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
34 changes: 0 additions & 34 deletions Migration-ToDo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Aktuell:

- Pagination of selects: Aktuell wird nicht DB-seitig paginiert, sondern immer die ganze Liste gefetched.
- remove all BaseDO.xxxId (lazy fetch) and replace callee by baseDO?.id
- Wicket: CalendarPage als Default ersetzen, CalendarPages remove.
- Entitygraphen nutzen: ConflictVacationCache, AuftragCache etc.
- Auftrag editieren: massenhaft SQLs
- employeeSalaryList: lädt wie blöde nach dem Editieren. (Excel-Exports auch zuviele SQLs)
Expand All @@ -23,11 +22,6 @@ Aktuell:
- Lazy-Breakpoint: AbstractLazyInitializer.initialize (#170)
org.hibernate.persister.entity.AbstractEntityPersister#generateSelectLazy:
postrgesql.conf:
log_lock_waits = on
deadlock_timeout = '500ms'
log_min_duration_statement = 1000 # Optional: loggt Abfragen, die länger als 1 Sekunde dauern

History
- Positionen etc. vernünftig anzeigen.

Expand Down Expand Up @@ -67,37 +61,9 @@ Später
Ganz später
- Kalenderlist ruft x-fach DB: FIND GroupDO resultClass=GroupDO auf.

Migration employee timed attrs:
select a.createdat, a.createdby, a.modifiedat, a.modifiedby, a.start_time, a.end_time, a.employee_id, a.group_name, b.value, b.propertyname, b.createdby, b.createdat, b.modifiedby, b.modifiedat from t_fibu_employee_timed a JOIN t_fibu_employee_timedattr b ON a.pk=b.parent;

employeestatus
employeeannualleave

- Produktion:
# In postgresql.conf (Neustart der Datenbank erforderlich)
lock_timeout = '300s' # 5 minutes timeout for locks.
statement_timeout = '300s' # 5 minutes timeout for SQL-commands.
Rollback:
update t_configuration set configurationtype='INTEGER' where configurationtype='LONG';
ALTER TABLE t_configuration RENAME COLUMN longvalue TO intvalue;

Folgendes muss nur gemacht werden, bevor die Version 8.0 erneut installiert wird (die alte Version 7.5.1 läuft auch ohne diese Änderungen):
DELETE FROM t_flyway_schema_version WHERE installed_rank >= 43;
ALTER TABLE t_pf_history_attr DROP COLUMN old_value;
ALTER TABLE t_pf_history_attr DROP COLUMN optype;
DROP TABLE t_orga_visitorbook_entry;
DROP TABLE t_fibu_employee_valid_since_attr;




Scripts:
Faktura-Quote nach KJ/GJ
- import java.util.Objects
- 114: EmployeeCache.instance.getEmployeeByUserId
- 37: data class User(val id: Long?, val username: String, val name: String, val firstName: String) : Comparable<User> {
- 266: var useYear = jahr?.toInt() ?: LocalDate.now().year
-

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class VisitorbookCache : AbstractCache() {
/**
* The key is the visitorbook id (database pk). Must be synchronized, because isn't only read.
*/
private var visitorbookMap: Map<Long, VisitorbookInfo> = emptyMap()
private var visitorbookMap = mutableMapOf<Long, VisitorbookInfo>()

fun getVisitorbookInfo(id: Long?): VisitorbookInfo? {
id ?: return null
Expand All @@ -57,9 +57,9 @@ open class VisitorbookCache : AbstractCache() {
fun setExpired(id: Long?) {
id ?: return // Should not happen.
val info = synchronized(visitorbookMap) {
visitorbookMap[id]
visitorbookMap[id] ?: VisitorbookInfo().also { visitorbookMap[id] = it }
}
info?.let { visitorbookInfo ->
info.let { visitorbookInfo ->
persistenceService.executeQuery(
queryVisitEntries,
VisitorbookEntryDO::class.java,
Expand Down

0 comments on commit 2c9ea00

Please sign in to comment.